Class: Telnyx::Resources::EmailDomains
- Inherits:
-
Object
- Object
- Telnyx::Resources::EmailDomains
- Defined in:
- lib/telnyx/resources/email_domains.rb,
lib/telnyx/resources/email_domains/webhooks.rb,
sig/telnyx/resources/email_domains.rbs,
sig/telnyx/resources/email_domains/webhooks.rbs
Defined Under Namespace
Classes: Webhooks
Instance Attribute Summary collapse
-
#webhooks ⇒ Telnyx::Resources::EmailDomains::Webhooks
readonly
Per-domain webhook endpoints with event subscriptions.
Instance Method Summary collapse
-
#create(domain:, dmarc_policy: nil, inbound_enabled: nil, tracking: nil, request_options: {}) ⇒ Telnyx::Models::EmailDomainResponse
Some parameter documentations has been truncated, see Models::EmailDomainCreateParams for more details.
-
#delete(id, force: nil, request_options: {}) ⇒ Telnyx::Models::EmailDomainResponse
Deletes an email domain configuration.
-
#initialize(client:) ⇒ EmailDomains
constructor
private
A new instance of EmailDomains.
-
#list(filter_domain: nil, filter_profile_id: nil, filter_status: nil, filter_type: nil, filter_usable_for_inbound: nil, filter_usable_for_sending: nil, page_after: nil, page_before: nil, page_number: nil, page_size: nil, sort: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::EmailDomain>
Shared (
type: shared) Telnyx-managed domains are included/readable for every account, in addition to the account's own custom domains. -
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::EmailDomainResponse
Shared (
type: shared) Telnyx-managed domains are included/readable for every account, in addition to the account's own custom domains. -
#retrieve_dns_records(domain_id, request_options: {}) ⇒ Telnyx::Models::EmailDomainRetrieveDNSRecordsResponse
Returns the DNS records Telnyx generated for domain ownership and DKIM verification, plus MX records when inbound delivery is enabled.
-
#retrieve_health(id, request_options: {}) ⇒ Telnyx::Models::EmailDomainRetrieveHealthResponse
Returns a summary of domain health including verification status and usability.
-
#update(id, dmarc_policy: nil, inbound_enabled: nil, tracking: nil, request_options: {}) ⇒ Telnyx::Models::EmailDomainResponse
Some parameter documentations has been truncated, see Models::EmailDomainUpdateParams for more details.
-
#verify(domain_id, request_options: {}) ⇒ Telnyx::Models::EmailDomainResponse
Checks the published DNS records against the records required for the email domain and returns the latest verification results.
Constructor Details
#initialize(client:) ⇒ EmailDomains
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 EmailDomains.
245 246 247 248 |
# File 'lib/telnyx/resources/email_domains.rb', line 245 def initialize(client:) @client = client @webhooks = Telnyx::Resources::EmailDomains::Webhooks.new(client: client) end |
Instance Attribute Details
#webhooks ⇒ Telnyx::Resources::EmailDomains::Webhooks (readonly)
Per-domain webhook endpoints with event subscriptions
8 9 10 |
# File 'lib/telnyx/resources/email_domains.rb', line 8 def webhooks @webhooks end |
Instance Method Details
#create(domain:, dmarc_policy: nil, inbound_enabled: nil, tracking: nil, request_options: {}) ⇒ Telnyx::Models::EmailDomainResponse
Some parameter documentations has been truncated, see Models::EmailDomainCreateParams for more details.
Registers a domain for email sending and optional inbound delivery. The response includes the domain configuration and current verification state.
re
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/telnyx/resources/email_domains.rb', line 32 def create(params) parsed, = Telnyx::EmailDomainCreateParams.dump_request(params) @client.request( method: :post, path: "email_domains", body: parsed, model: Telnyx::EmailDomainResponse, options: ) end |
#delete(id, force: nil, request_options: {}) ⇒ Telnyx::Models::EmailDomainResponse
Deletes an email domain configuration. Verified domains require force=true,
and shared domains are read-only for non-owner accounts.
168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/telnyx/resources/email_domains.rb', line 168 def delete(id, params = {}) parsed, = Telnyx::EmailDomainDeleteParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :delete, path: ["email_domains/%1$s", id], query: query, model: Telnyx::EmailDomainResponse, options: ) end |
#list(filter_domain: nil, filter_profile_id: nil, filter_status: nil, filter_type: nil, filter_usable_for_inbound: nil, filter_usable_for_sending: nil, page_after: nil, page_before: nil, page_number: nil, page_size: nil, sort: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::EmailDomain>
Shared (type: shared) Telnyx-managed domains are included/readable for every
account, in addition to the account's own custom domains.
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/telnyx/resources/email_domains.rb', line 130 def list(params = {}) parsed, = Telnyx::EmailDomainListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "email_domains", query: query.transform_keys( filter_domain: "filter[domain]", filter_profile_id: "filter[profile_id]", filter_status: "filter[status]", filter_type: "filter[type]", filter_usable_for_inbound: "filter[usable_for_inbound]", filter_usable_for_sending: "filter[usable_for_sending]", page_after: "page[after]", page_before: "page[before]", page_number: "page[number]", page_size: "page[size]" ), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::EmailDomain, options: ) end |
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::EmailDomainResponse
Shared (type: shared) Telnyx-managed domains are included/readable for every
account, in addition to the account's own custom domains.
55 56 57 58 59 60 61 62 |
# File 'lib/telnyx/resources/email_domains.rb', line 55 def retrieve(id, params = {}) @client.request( method: :get, path: ["email_domains/%1$s", id], model: Telnyx::EmailDomainResponse, options: params[:request_options] ) end |
#retrieve_dns_records(domain_id, request_options: {}) ⇒ Telnyx::Models::EmailDomainRetrieveDNSRecordsResponse
Returns the DNS records Telnyx generated for domain ownership and DKIM verification, plus MX records when inbound delivery is enabled.
192 193 194 195 196 197 198 199 |
# File 'lib/telnyx/resources/email_domains.rb', line 192 def retrieve_dns_records(domain_id, params = {}) @client.request( method: :get, path: ["email_domains/%1$s/dns_records", domain_id], model: Telnyx::Models::EmailDomainRetrieveDNSRecordsResponse, options: params[:request_options] ) end |
#retrieve_health(id, request_options: {}) ⇒ Telnyx::Models::EmailDomainRetrieveHealthResponse
Returns a summary of domain health including verification status and usability.
212 213 214 215 216 217 218 219 |
# File 'lib/telnyx/resources/email_domains.rb', line 212 def retrieve_health(id, params = {}) @client.request( method: :get, path: ["email_domains/%1$s/health", id], model: Telnyx::Models::EmailDomainRetrieveHealthResponse, options: params[:request_options] ) end |
#update(id, dmarc_policy: nil, inbound_enabled: nil, tracking: nil, request_options: {}) ⇒ Telnyx::Models::EmailDomainResponse
Some parameter documentations has been truncated, see Models::EmailDomainUpdateParams for more details.
Updates mutable settings for an existing email domain, including inbound delivery and tracking configuration. Shared domains are read-only for non-owner accounts.
re
87 88 89 90 91 92 93 94 95 96 |
# File 'lib/telnyx/resources/email_domains.rb', line 87 def update(id, params = {}) parsed, = Telnyx::EmailDomainUpdateParams.dump_request(params) @client.request( method: :patch, path: ["email_domains/%1$s", id], body: parsed, model: Telnyx::EmailDomainResponse, options: ) end |
#verify(domain_id, request_options: {}) ⇒ Telnyx::Models::EmailDomainResponse
Checks the published DNS records against the records required for the email domain and returns the latest verification results.
233 234 235 236 237 238 239 240 |
# File 'lib/telnyx/resources/email_domains.rb', line 233 def verify(domain_id, params = {}) @client.request( method: :post, path: ["email_domains/%1$s/verify", domain_id], model: Telnyx::EmailDomainResponse, options: params[:request_options] ) end |