Module: Conversations

Included in:
Content
Defined in:
lib/user/content/conversations.rb,
lib/contact/content/conversations.rb

Instance Method Summary collapse

Instance Method Details

#attach_contact_in_conversation(id, data) ⇒ Object

Attach contact in conversation.

Attach a contact in a conversation.

Parameters

id

(Integer) – Conversation id.

data

(Hash) – Data to be submitted.

Example

data = {
  contact_id: 2
}
@data = @mints_user.attach_contact_in_conversation(1, data)


157
158
159
# File 'lib/user/content/conversations.rb', line 157

def attach_contact_in_conversation(id, data)
  @client.raw('post', "/content/conversations/#{id}/attach-contact", nil, data_transform(data))
end

#attach_form_in_conversation(id, data) ⇒ Object

Attach form in conversation.

Attach a form in a conversation.

Parameters

id

(Integer) – Conversation id.

data

(Hash) – Data to be submitted.

Example

data = {
  form_id: 2
}
@data = @mints_user.attach_form_in_conversation(1, data)


189
190
191
# File 'lib/user/content/conversations.rb', line 189

def attach_form_in_conversation(id, data)
  @client.raw('post', "/content/conversations/#{id}/attach-form", nil, data_transform(data))
end

#attach_user_in_conversation(id, data) ⇒ Object

Attach user in conversation.

Attach an user in a conversation.

Parameters

id

(Integer) – Conversation id.

data

(Hash) – Data to be submitted.

Example

data = {
  user_id: 2
}
@data = @mints_user.attach_user_in_conversation(13, data)


125
126
127
# File 'lib/user/content/conversations.rb', line 125

def attach_user_in_conversation(id, data)
  @client.raw('post', "/content/conversations/#{id}/attach-user", nil, data_transform(data))
end

#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)


53
54
55
# File 'lib/user/content/conversations.rb', line 53

def create_conversation(data, options = nil)
  @client.raw('post', '/content/conversations', options, data_transform(data))
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

#delete_conversation(id) ⇒ Object

Delete conversation.

Delete a conversation.

Parameters

id

(Integer) – Conversation id.

Example

@data = @mints_user.delete_conversation(11)


81
82
83
# File 'lib/user/content/conversations.rb', line 81

def delete_conversation(id)
  @client.raw('delete', "/content/conversations/#{id}")
end

#detach_contact_in_conversation(id, data) ⇒ Object

Detach contact in conversation.

Detach a contact in a conversation.

Parameters

id

(Integer) – Contact id.

data

(Hash) – Data to be submitted.

Example

data = {
  contact_id: 2
}
@data = @mints_user.detach_contact_in_conversation(1, data)


173
174
175
# File 'lib/user/content/conversations.rb', line 173

def detach_contact_in_conversation(id, data)
  @client.raw('post', "/content/conversations/#{id}/detach-contact", nil, data_transform(data))
end

#detach_form_in_conversation(id, data) ⇒ Object

Detach form in conversation.

Detach a form in a conversation.

Parameters

id

(Integer) – Contact id.

data

(Hash) – Data to be submitted.

Example

data = {
  form_id: 2
}
@data = @mints_user.detach_form_in_conversation(1, data)


205
206
207
# File 'lib/user/content/conversations.rb', line 205

def detach_form_in_conversation(id, data)
  @client.raw('post', "/content/conversations/#{id}/detach-form", nil, data_transform(data))
end

#detach_user_in_conversation(id, data) ⇒ Object

Detach user in conversation.

Detach an user in a conversation.

Parameters

id

(Integer) – Conversation id.

data

(Hash) – Data to be submitted.

Example

data = {
  user_id: 2
}
@data = @mints_user.detach_user_in_conversation(13, data)


141
142
143
# File 'lib/user/content/conversations.rb', line 141

def detach_user_in_conversation(id, data)
  @client.raw('post', "/content/conversations/#{id}/detach-user", nil, data_transform(data))
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.



38
39
40
# File 'lib/user/content/conversations.rb', line 38

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

#get_conversation_participants(id) ⇒ Object

Get Conversation Participants.

Update a conversation participants.

Parameters

id

(Integer) – Conversation id.

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



109
110
111
# File 'lib/user/content/conversations.rb', line 109

def get_conversation_participants(id)
  @client.raw('get', "/content/conversations/#{id}/participants")
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.



21
22
23
# File 'lib/user/content/conversations.rb', line 21

def get_conversations(options = nil)
  @client.raw('get', '/content/conversations', options)
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.



69
70
71
# File 'lib/user/content/conversations.rb', line 69

def update_conversation(id, data, options = nil)
  @client.raw('put', "/content/conversations/#{id}", options, data_transform(data))
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.



97
98
99
# File 'lib/user/content/conversations.rb', line 97

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