Class: Telnyx::Resources::EmailInboxes::Filters

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

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

Parameters:



116
117
118
# File 'lib/telnyx/resources/email_inboxes/filters.rb', line 116

def initialize(client:)
  @client = client
end

Instance Method Details

#add(inbox_id, entries:, type:, request_options: {}) ⇒ Telnyx::Models::EmailInboxes::FilterAddResponse

Adds entries to either the allowlist or blocklist. The operation is an idempotent set union: entries already present remain unchanged.

Parameters:

Returns:

See Also:



47
48
49
50
51
52
53
54
55
56
# File 'lib/telnyx/resources/email_inboxes/filters.rb', line 47

def add(inbox_id, params)
  parsed, options = Telnyx::EmailInboxes::FilterAddParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["email_inboxes/%1$s/filters", inbox_id],
    body: parsed,
    model: Telnyx::Models::EmailInboxes::FilterAddResponse,
    options: options
  )
end

#delete_all(inbox_id, entries:, type:, request_options: {}) ⇒ Telnyx::Models::EmailInboxes::FilterDeleteAllResponse

Removes entries from either the allowlist or blocklist. The operation is idempotent: removing an entry that is not present still returns the current filter lists.

Parameters:

Returns:

See Also:



75
76
77
78
79
80
81
82
83
84
# File 'lib/telnyx/resources/email_inboxes/filters.rb', line 75

def delete_all(inbox_id, params)
  parsed, options = Telnyx::EmailInboxes::FilterDeleteAllParams.dump_request(params)
  @client.request(
    method: :delete,
    path: ["email_inboxes/%1$s/filters", inbox_id],
    body: parsed,
    model: Telnyx::Models::EmailInboxes::FilterDeleteAllResponse,
    options: options
  )
end

#list(inbox_id, request_options: {}) ⇒ Telnyx::Models::EmailInboxes::FilterListResponse

Returns the inbox's sender allowlist and blocklist. Entries are normalized to lowercase. A blocklist match takes precedence over an allowlist match; when both lists are empty, all senders are accepted.

Parameters:

Returns:

See Also:



22
23
24
25
26
27
28
29
# File 'lib/telnyx/resources/email_inboxes/filters.rb', line 22

def list(inbox_id, params = {})
  @client.request(
    method: :get,
    path: ["email_inboxes/%1$s/filters", inbox_id],
    model: Telnyx::Models::EmailInboxes::FilterListResponse,
    options: params[:request_options]
  )
end

#replace(inbox_id, allowlist: nil, blocklist: nil, request_options: {}) ⇒ Telnyx::Models::EmailInboxes::FilterReplaceResponse

Replaces both sender filter lists atomically. Omitting either list clears that list. Use POST or DELETE for incremental changes.

Parameters:

  • inbox_id (String)

    Email inbox UUID.

  • allowlist (Array<String>)
  • blocklist (Array<String>)
  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



102
103
104
105
106
107
108
109
110
111
# File 'lib/telnyx/resources/email_inboxes/filters.rb', line 102

def replace(inbox_id, params = {})
  parsed, options = Telnyx::EmailInboxes::FilterReplaceParams.dump_request(params)
  @client.request(
    method: :put,
    path: ["email_inboxes/%1$s/filters", inbox_id],
    body: parsed,
    model: Telnyx::Models::EmailInboxes::FilterReplaceResponse,
    options: options
  )
end