Class: Sentdm::Resources::Conversations
- Inherits:
-
Object
- Object
- Sentdm::Resources::Conversations
- Defined in:
- lib/sentdm/resources/conversations.rb,
sig/sentdm/resources/conversations.rbs
Instance Method Summary collapse
-
#initialize(client:) ⇒ Conversations
constructor
private
A new instance of Conversations.
-
#list(page:, page_size:, x_profile_id: nil, request_options: {}) ⇒ Sentdm::Models::APIResponseOfConversationMessagesList
Some parameter documentations has been truncated, see Models::ConversationListParams for more details.
-
#list_messages(id, page:, page_size:, x_profile_id: nil, request_options: {}) ⇒ Sentdm::Models::APIResponseOfConversationMessagesList
Some parameter documentations has been truncated, see Models::ConversationListMessagesParams for more details.
Constructor Details
#initialize(client:) ⇒ Conversations
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Conversations.
77 78 79 |
# File 'lib/sentdm/resources/conversations.rb', line 77 def initialize(client:) @client = client end |
Instance Method Details
#list(page:, page_size:, x_profile_id: nil, request_options: {}) ⇒ Sentdm::Models::APIResponseOfConversationMessagesList
Some parameter documentations has been truncated, see Models::ConversationListParams for more details.
Retrieves a paginated list of the authenticated customer's messages across all conversations, ordered by created date (most recent first).
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/sentdm/resources/conversations.rb', line 25 def list(params) query_params = [:page, :page_size] parsed, = Sentdm::ConversationListParams.dump_request(params) query = Sentdm::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :get, path: "v3/conversations", query: query, headers: parsed.except(*query_params).transform_keys(x_profile_id: "x-profile-id"), model: Sentdm::APIResponseOfConversationMessagesList, options: ) end |
#list_messages(id, page:, page_size:, x_profile_id: nil, request_options: {}) ⇒ Sentdm::Models::APIResponseOfConversationMessagesList
Some parameter documentations has been truncated, see Models::ConversationListMessagesParams for more details.
Retrieves a paginated list of the messages in a single conversation (scoped to the authenticated customer), ordered by created date (most recent first).
60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/sentdm/resources/conversations.rb', line 60 def (id, params) query_params = [:page, :page_size] parsed, = Sentdm::ConversationListMessagesParams.dump_request(params) query = Sentdm::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :get, path: ["v3/conversations/%1$s", id], query: query, headers: parsed.except(*query_params).transform_keys(x_profile_id: "x-profile-id"), model: Sentdm::APIResponseOfConversationMessagesList, options: ) end |