Module: Conversations
- Included in:
- Content
- Defined in:
- lib/user/content/conversations.rb
Instance Method Summary collapse
-
#attach_contact_in_conversation(id, data) ⇒ Object
Attach contact in conversation.
-
#attach_user_in_conversation(id, data) ⇒ Object
Attach user in conversation.
-
#create_conversation(data) ⇒ Object
Create conversation.
-
#delete_conversation(id) ⇒ Object
Delete conversation.
-
#detach_contact_in_conversation(id, data) ⇒ Object
Detach contact in conversation.
-
#detach_user_in_conversation(id, data) ⇒ Object
Detach user in conversation.
-
#get_conversation(id, options = nil) ⇒ Object
Get conversation.
-
#get_conversation_participants(id) ⇒ Object
Get conversation participants.
-
#get_conversations(options = nil) ⇒ Object
Get conversations.
-
#update_conversation(id, data) ⇒ Object
Update conversation.
-
#update_conversation_status(id, data) ⇒ Object
Update conversation status.
Instance Method Details
permalink #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 submited.
Example
data = {
"contact_id": 2
}
@data = @mints_user.attach_contact_in_conversation(1, data)
155 156 157 |
# File 'lib/user/content/conversations.rb', line 155 def attach_contact_in_conversation(id, data) return @client.raw("post", "/content/conversations/#{id}/attach-contact", nil, data_transform(data)) end |
permalink #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 submited.
Example
data = {
"user_id": 2
}
@data = @mints_user.attach_user_in_conversation(13, data)
123 124 125 |
# File 'lib/user/content/conversations.rb', line 123 def attach_user_in_conversation(id, data) return @client.raw("post", "/content/conversations/#{id}/attach-user", nil, data_transform(data)) end |
permalink #create_conversation(data) ⇒ Object
Create conversation.
Create a conversation with data.
Parameters
- data
-
(Hash) – Data to be submited.
Example
data = {
"title": "New Conversation"
}
@data = @mints_user.create_conversation(data)
51 52 53 |
# File 'lib/user/content/conversations.rb', line 51 def create_conversation(data) return @client.raw("post", "/content/conversations", nil, data_transform(data)) end |
permalink #delete_conversation(id) ⇒ Object
Delete conversation.
Delete a conversation.
Parameters
- id
-
(Integer) – Conversation id.
Example
@data = @mints_user.delete_conversation(11)
79 80 81 |
# File 'lib/user/content/conversations.rb', line 79 def delete_conversation(id) return @client.raw("delete", "/content/conversations/#{id}") end |
permalink #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 submited.
Example
data = {
"contact_id": 2
}
@data = @mints_user.detach_contact_in_conversation(1, data)
171 172 173 |
# File 'lib/user/content/conversations.rb', line 171 def detach_contact_in_conversation(id, data) return @client.raw("post", "/content/conversations/#{id}/detach-contact", nil, data_transform(data)) end |
permalink #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 submited.
Example
data = {
"user_id": 2
}
@data = @mints_user.detach_user_in_conversation(13, data)
139 140 141 |
# File 'lib/user/content/conversations.rb', line 139 def detach_user_in_conversation(id, data) return @client.raw("post", "/content/conversations/#{id}/detach-user", nil, data_transform(data)) end |
permalink #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.
First Example
@data = @mints_user.get_conversation(1)
Second Example
= { "fields": "title" }
@data = @mints_user.get_conversation(1, )
36 37 38 |
# File 'lib/user/content/conversations.rb', line 36 def get_conversation(id, = nil) return @client.raw("get", "/content/conversations/#{id}", ) end |
permalink #get_conversation_participants(id) ⇒ Object
Get conversation participants.
Get participants in a conversation.
Parameters
- id
-
(Integer) – Conversation id.
Example
@data = @mints_user.get_conversation_participants(1)
107 108 109 |
# File 'lib/user/content/conversations.rb', line 107 def get_conversation_participants(id) return @client.raw("get", "/content/conversations/#{id}/participants") end |
permalink #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.
First Example
@data = @mints_user.get_conversations
Second Example
= { "fields": "title" }
@data = @mints_user.get_conversations()
19 20 21 |
# File 'lib/user/content/conversations.rb', line 19 def get_conversations( = nil) return @client.raw("get", "/content/conversations", ) end |
permalink #update_conversation(id, data) ⇒ Object
Update conversation.
Update a conversation info.
Parameters
- id
-
(Integer) – Conversation id.
- data
-
(Hash) – Data to be submited.
Example
data = {
"title": "New Conversation Modified"
}
@data = @mints_user.update_conversation(13, data)
67 68 69 |
# File 'lib/user/content/conversations.rb', line 67 def update_conversation(id, data) return @client.raw("put", "/content/conversations/#{id}", nil, data_transform(data)) end |
permalink #update_conversation_status(id, data) ⇒ Object
Update conversation status.
Update a conversation status.
Parameters
- id
-
(Integer) – Conversation id.
- data
-
(Hash) – Data to be submited.
Example
data = {
"status": "read"
}
@data = @mints_user.update_conversation_status(13, data)
95 96 97 |
# File 'lib/user/content/conversations.rb', line 95 def update_conversation_status(id, data) return @client.raw("put", "/content/conversations/#{id}/status", nil, data_transform(data)) end |