Class: Telnyx::Resources::EmailInboxes::Messages
- Inherits:
-
Object
- Object
- Telnyx::Resources::EmailInboxes::Messages
- Defined in:
- lib/telnyx/resources/email_inboxes/messages.rb,
lib/telnyx/resources/email_inboxes/messages/labels.rb,
lib/telnyx/resources/email_inboxes/messages/actions.rb,
sig/telnyx/resources/email_inboxes/messages.rbs,
sig/telnyx/resources/email_inboxes/messages/labels.rbs,
sig/telnyx/resources/email_inboxes/messages/actions.rbs
Defined Under Namespace
Instance Attribute Summary collapse
-
#actions ⇒ Telnyx::Resources::EmailInboxes::Messages::Actions
readonly
Create and manage agent inboxes, retrieve inbound messages and threads, and reply to or forward messages.
-
#labels ⇒ Telnyx::Resources::EmailInboxes::Messages::Labels
readonly
Create and manage agent inboxes, retrieve inbound messages and threads, and reply to or forward messages.
Instance Method Summary collapse
-
#drafts(message_id, inbox_id:, attachments: nil, bcc: nil, cc: nil, from_email: nil, from_name: nil, headers: nil, html: nil, html_body: nil, labels: nil, metadata: nil, reply_to: nil, subject: nil, tags: nil, text: nil, text_body: nil, to: nil, request_options: {}) ⇒ Telnyx::Models::EmailInboxes::EmailDraftResponse
Creates an unsent reply draft for an inbound message.
-
#initialize(client:) ⇒ Messages
constructor
private
A new instance of Messages.
-
#list(inbox_id, filter_from: nil, filter_label: nil, filter_read: nil, filter_received_after: nil, filter_received_before: nil, filter_search: nil, filter_subject: nil, filter_unread: nil, page_after: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Models::EmailInboxes::MessageListResponse
Some parameter documentations has been truncated, see Models::EmailInboxes::MessageListParams for more details.
-
#update(message_id, inbox_id:, read_at:, request_options: {}) ⇒ Telnyx::Models::EmailInboxes::MessageUpdateResponse
Some parameter documentations has been truncated, see Models::EmailInboxes::MessageUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Messages
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 Messages.
183 184 185 186 187 |
# File 'lib/telnyx/resources/email_inboxes/messages.rb', line 183 def initialize(client:) @client = client @actions = Telnyx::Resources::EmailInboxes::Messages::Actions.new(client: client) @labels = Telnyx::Resources::EmailInboxes::Messages::Labels.new(client: client) end |
Instance Attribute Details
#actions ⇒ Telnyx::Resources::EmailInboxes::Messages::Actions (readonly)
Create and manage agent inboxes, retrieve inbound messages and threads, and reply to or forward messages.
10 11 12 |
# File 'lib/telnyx/resources/email_inboxes/messages.rb', line 10 def actions @actions end |
#labels ⇒ Telnyx::Resources::EmailInboxes::Messages::Labels (readonly)
Create and manage agent inboxes, retrieve inbound messages and threads, and reply to or forward messages.
15 16 17 |
# File 'lib/telnyx/resources/email_inboxes/messages.rb', line 15 def labels @labels end |
Instance Method Details
#drafts(message_id, inbox_id:, attachments: nil, bcc: nil, cc: nil, from_email: nil, from_name: nil, headers: nil, html: nil, html_body: nil, labels: nil, metadata: nil, reply_to: nil, subject: nil, tags: nil, text: nil, text_body: nil, to: nil, request_options: {}) ⇒ Telnyx::Models::EmailInboxes::EmailDraftResponse
Creates an unsent reply draft for an inbound message. Unlike the
/actions/reply endpoint, which sends immediately, this stores a draft that can
be reviewed and edited before sending.
reply_to_message_id and thread_id are inherited from the parent message and
cannot be set by the caller. The recipient, Re: subject and
In-Reply-To/References headers are pre-filled from the parent using the same
rules as a live reply, so sending the draft threads identically. Supplying to
or subject explicitly overrides the pre-filled value.
165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/telnyx/resources/email_inboxes/messages.rb', line 165 def drafts(, params) parsed, = Telnyx::EmailInboxes::MessageDraftsParams.dump_request(params) inbox_id = parsed.delete(:inbox_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :post, path: ["email_inboxes/%1$s/messages/%2$s/drafts", inbox_id, ], body: parsed, model: Telnyx::EmailInboxes::EmailDraftResponse, options: ) end |
#list(inbox_id, filter_from: nil, filter_label: nil, filter_read: nil, filter_received_after: nil, filter_received_before: nil, filter_search: nil, filter_subject: nil, filter_unread: nil, page_after: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Models::EmailInboxes::MessageListResponse
Some parameter documentations has been truncated, see Models::EmailInboxes::MessageListParams for more details.
Lists inbound messages newest first. All access is scoped to the authenticated
account. filter[search] performs PostgreSQL full-text search over the subject,
plain-text body, and HTML body. Filters compose with stable cursor pagination.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/telnyx/resources/email_inboxes/messages.rb', line 89 def list(inbox_id, params = {}) parsed, = Telnyx::EmailInboxes::MessageListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["email_inboxes/%1$s/messages", inbox_id], query: query.transform_keys( filter_from: "filter[from]", filter_label: "filter[label]", filter_read: "filter[read]", filter_received_after: "filter[received_after]", filter_received_before: "filter[received_before]", filter_search: "filter[search]", filter_subject: "filter[subject]", filter_unread: "filter[unread]", page_after: "page[after]", page_size: "page[size]" ), model: Telnyx::Models::EmailInboxes::MessageListResponse, options: ) end |
#update(message_id, inbox_id:, read_at:, request_options: {}) ⇒ Telnyx::Models::EmailInboxes::MessageUpdateResponse
Some parameter documentations has been truncated, see Models::EmailInboxes::MessageUpdateParams for more details.
Updates the explicit read state of an account-scoped inbound message. Set
read_at to true to mark the message read at the server's current time, to an
ISO 8601 timestamp to use that timestamp, or to null to mark the message
unread. Repeating the same update is idempotent.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/telnyx/resources/email_inboxes/messages.rb', line 38 def update(, params) parsed, = Telnyx::EmailInboxes::MessageUpdateParams.dump_request(params) inbox_id = parsed.delete(:inbox_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :patch, path: ["email_inboxes/%1$s/messages/%2$s", inbox_id, ], body: parsed, model: Telnyx::Models::EmailInboxes::MessageUpdateResponse, options: ) end |