Module: ContactConversations

Included in:
ContactContent
Defined in:
lib/contact/content/conversations.rb

Instance Method Summary collapse

Instance Method Details

#create_conversation(data) ⇒ Object

Create Conversation.

Create a conversation with data.

Parameters

data

(Hash) – Data to be submitted.

Example

data = {
  title: 'New Conversation To Test'
}
@data = @mints_contact.create_conversation(data)


39
40
41
# File 'lib/contact/content/conversations.rb', line 39

def create_conversation(data)
  @client.raw('post', '/content/conversations', nil, data_transform(data), @contact_v1_url)
end

#create_message(data) ⇒ Object

Create Message.

Create a message with data.

Parameters

data

(Hash) – Data to be submitted.

Example

data = {
  conversation_id: 3,
  type: 'text',
  value: {
    text: 'Message Text'
  }
}
@data = @mints_contact.create_message(data)


118
119
120
# File 'lib/contact/content/conversations.rb', line 118

def create_message(data)
  @client.raw('post', '/content/messages', nil, data_transform(data), @contact_v1_url)
end

#get_conversation(id, options = nil) ⇒ Object

Get Conversation.

Get a conversation info.

Parameters

id

(Integer) – Conversation id.

options

(Hash) – List of Resource Collection Options shown above can be used as parameter.

FIXME: This method doesn’t return data.



23
24
25
# File 'lib/contact/content/conversations.rb', line 23

def get_conversation(id, options = nil)
  @client.raw('get', "/content/conversations/#{id}", options, nil, @contact_v1_url)
end

#get_conversation_participants(id) ⇒ Object

Get Conversation Participants.

Get a conversation participants.

Parameters

id

(Integer) – Conversation id.

FIXME: This method doesn’t locate conversation id to be updated.



74
75
76
77
# File 'lib/contact/content/conversations.rb', line 74

def get_conversation_participants(id)
  #TODO: Test if this method needs data in options.
  @client.raw('get', "/content/conversations/#{id}/participants", nil, nil, @contact_v1_url)
end

#get_conversations(options = nil) ⇒ Object

Get Conversations.

Get a collection of conversations.

Parameters

options

(Hash) – List of Resource Collection Options shown above can be used as parameter.

FIXME: This method doesn’t return data.



11
12
13
# File 'lib/contact/content/conversations.rb', line 11

def get_conversations(options = nil)
  @client.raw('get', '/content/conversations', options, nil, @contact_v1_url)
end

#get_message(id, options = nil) ⇒ Object

Get Message.

Get a message info.

Parameters

id

(Integer) – Message id.

options

(Hash) – List of Resource Collection Options shown above can be used as parameter.

FIXME: This method doesn’t return data.



98
99
100
# File 'lib/contact/content/conversations.rb', line 98

def get_message(id, options = nil)
  @client.raw('get', "/content/messages/#{id}", options, nil, @contact_v1_url)
end

#get_messages(options = nil) ⇒ Object

Get Messages.

Get a collection of messages.

Parameters

options

(Hash) – List of Resource Collection Options shown above can be used as parameter.

FIXME: This method doesn’t return data.



86
87
88
# File 'lib/contact/content/conversations.rb', line 86

def get_messages(options = nil)
  @client.raw('get', '/content/messages', options, nil, @contact_v1_url)
end

#update_conversation(id, data) ⇒ Object

Update Conversation.

Update a location template info.

Parameters

id

(Integer) – Conversation id.

data

(Hash) – Data to be submitted.

FIXME: This method doesn’t locate conversation id to be updated.



51
52
53
# File 'lib/contact/content/conversations.rb', line 51

def update_conversation(id, data)
  @client.raw('put', "/content/conversations/#{id}", nil, data_transform(data), @contact_v1_url)
end

#update_conversation_status(id, data) ⇒ Object

Update Conversation Status.

Update a conversation status.

Parameters

id

(Integer) – Conversation id.

data

(Hash) – Data to be submitted.

FIXME: This method doesn’t locate conversation id to be updated.



63
64
65
# File 'lib/contact/content/conversations.rb', line 63

def update_conversation_status(id, data)
  @client.raw('put', "/content/conversations/#{id}/status", nil, data_transform(data), @contact_v1_url)
end