Class: Telnyx::Resources::EmailInboxes::Messages::Labels

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/email_inboxes/messages/labels.rb,
sig/telnyx/resources/email_inboxes/messages/labels.rbs

Overview

Create and manage agent inboxes, retrieve inbound messages and threads, and reply to or forward messages.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Labels

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 Labels.

Parameters:



91
92
93
# File 'lib/telnyx/resources/email_inboxes/messages/labels.rb', line 91

def initialize(client:)
  @client = client
end

Instance Method Details

#create(message_id, inbox_id:, labels:, request_options: {}) ⇒ Telnyx::Models::EmailInboxes::Messages::LabelCreateResponse

Some parameter documentations has been truncated, see Models::EmailInboxes::Messages::LabelCreateParams for more details.

Adds one or more mutable labels to a message. Labels carry agent workflow state such as spam, needs_review, or processed.

Labels are not the same as the send-time tags on outbound messages: tags are immutable and propagate to Email Detail Records and Mission Control for billing attribution, while labels are mailbox state that never reaches the reporting contract.

The operation is an idempotent set union — adding a label the message already carries is a no-op and still returns 200. Labels are case-sensitive, and message labels are independent of thread labels.

Parameters:

  • message_id (String)

    Path param: Inbound message UUID.

  • inbox_id (String)

    Path param: Email inbox UUID.

  • labels (Array<String>)

    Body param: One or more labels. Each label is a freeform, case-sensitive string

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/telnyx/resources/email_inboxes/messages/labels.rb', line 38

def create(message_id, params)
  parsed, options = Telnyx::EmailInboxes::Messages::LabelCreateParams.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/labels", inbox_id, message_id],
    body: parsed,
    model: Telnyx::Models::EmailInboxes::Messages::LabelCreateResponse,
    options: options
  )
end

#delete_all(message_id, inbox_id:, labels:, request_options: {}) ⇒ Telnyx::Models::EmailInboxes::Messages::LabelDeleteAllResponse

Some parameter documentations has been truncated, see Models::EmailInboxes::Messages::LabelDeleteAllParams for more details.

Removes one or more labels from a message. Idempotent — removing a label the message does not carry is a no-op and still returns 200. Removal is case-sensitive.

Parameters:

  • message_id (String)

    Path param: Inbound message UUID.

  • inbox_id (String)

    Path param: Email inbox UUID.

  • labels (Array<String>)

    Body param: One or more labels. Each label is a freeform, case-sensitive string

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/telnyx/resources/email_inboxes/messages/labels.rb', line 73

def delete_all(message_id, params)
  parsed, options = Telnyx::EmailInboxes::Messages::LabelDeleteAllParams.dump_request(params)
  inbox_id =
    parsed.delete(:inbox_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :delete,
    path: ["email_inboxes/%1$s/messages/%2$s/labels", inbox_id, message_id],
    body: parsed,
    model: Telnyx::Models::EmailInboxes::Messages::LabelDeleteAllResponse,
    options: options
  )
end