Class: Helpful::Api::Conversations
- Inherits:
-
Object
- Object
- Helpful::Api::Conversations
- Defined in:
- lib/helpful/api/conversations.rb
Overview
Conversations in an account
Instance Method Summary collapse
-
#all(account_id, options = {}) ⇒ Object
List all conversations in an account the user has access to.
-
#create(account_id, options = {}) ⇒ Object
Create an empty conversation in account the user has access to.
-
#get(conversation_id, options = {}) ⇒ Object
Get a conversation the user has access to.
-
#initialize(client) ⇒ Conversations
constructor
A new instance of Conversations.
Constructor Details
#initialize(client) ⇒ Conversations
Returns a new instance of Conversations.
8 9 10 |
# File 'lib/helpful/api/conversations.rb', line 8 def initialize(client) @client = client end |
Instance Method Details
#all(account_id, options = {}) ⇒ Object
List all conversations in an account the user has access to
‘/accounts/:account_id/conversations’ GET
account_id - Identifier of the account
17 18 19 20 21 |
# File 'lib/helpful/api/conversations.rb', line 17 def all(account_id, = {}) body = .fetch(:query, {}) @client.get("/accounts/#{account_id}/conversations", body, ) end |
#create(account_id, options = {}) ⇒ Object
Create an empty conversation in account the user has access to
‘/accounts/:account_id/conversations’ POST
account_id - Identifier of the account
28 29 30 31 32 |
# File 'lib/helpful/api/conversations.rb', line 28 def create(account_id, = {}) body = .fetch(:body, {}) @client.post("/accounts/#{account_id}/conversations", body, ) end |
#get(conversation_id, options = {}) ⇒ Object
Get a conversation the user has access to
‘/conversations/:conversation_id’ GET
conversation_id - Identifier of the conversation
39 40 41 42 43 |
# File 'lib/helpful/api/conversations.rb', line 39 def get(conversation_id, = {}) body = .fetch(:query, {}) @client.get("/conversations/#{conversation_id}", body, ) end |