Class: Telnyx::Resources::EmailInboxes::Threads::Labels

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/email_inboxes/threads/labels.rb,
sig/telnyx/resources/email_inboxes/threads/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:



86
87
88
# File 'lib/telnyx/resources/email_inboxes/threads/labels.rb', line 86

def initialize(client:)
  @client = client
end

Instance Method Details

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

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

Adds one or more mutable labels to a thread, letting an agent mark a whole conversation (for example needs_review) without labelling each message individually.

Thread labels are independent of message labels: labelling a thread does not label its messages, and labelling a message does not label its thread. Idempotent and case-sensitive.

Parameters:

  • thread_id (String)

    Path param: Thread 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:



34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/telnyx/resources/email_inboxes/threads/labels.rb', line 34

def create(thread_id, params)
  parsed, options = Telnyx::EmailInboxes::Threads::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/threads/%2$s/labels", inbox_id, thread_id],
    body: parsed,
    model: Telnyx::Models::EmailInboxes::Threads::LabelCreateResponse,
    options: options
  )
end

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

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

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

Parameters:

  • thread_id (String)

    Path param: Thread 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:



68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/telnyx/resources/email_inboxes/threads/labels.rb', line 68

def delete_all(thread_id, params)
  parsed, options = Telnyx::EmailInboxes::Threads::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/threads/%2$s/labels", inbox_id, thread_id],
    body: parsed,
    model: Telnyx::Models::EmailInboxes::Threads::LabelDeleteAllResponse,
    options: options
  )
end