Class: Sendmux::Management::Generated::DomainsApi
- Inherits:
-
Object
- Object
- Sendmux::Management::Generated::DomainsApi
- Defined in:
- lib/sendmux_management_generated/api/domains_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#initialize(api_client = ApiClient.default) ⇒ DomainsApi
constructor
A new instance of DomainsApi.
-
#management_create_domain(opts = {}) ⇒ DomainItemResponse
Add a mailbox domain Creates a new domain and returns the DNS records the customer must place before verification can succeed.
-
#management_create_domain_with_http_info(opts = {}) ⇒ Array<(DomainItemResponse, Integer, Hash)>
Add a mailbox domain Creates a new domain and returns the DNS records the customer must place before verification can succeed.
-
#management_delete_domain(public_id, opts = {}) ⇒ DomainDeletedResponse
Delete a mailbox domain Removes a domain from our mail platform, Amazon SES, and Sendmux.
-
#management_delete_domain_with_http_info(public_id, opts = {}) ⇒ Array<(DomainDeletedResponse, Integer, Hash)>
Delete a mailbox domain Removes a domain from our mail platform, Amazon SES, and Sendmux.
-
#management_get_domain(public_id, opts = {}) ⇒ DomainItemResponse
Get a mailbox domain Returns a single domain including its DNS records and latest verification state.
-
#management_get_domain_with_http_info(public_id, opts = {}) ⇒ Array<(DomainItemResponse, Integer, Hash)>
Get a mailbox domain Returns a single domain including its DNS records and latest verification state.
-
#management_get_domain_zone_file(public_id, opts = {}) ⇒ String
Download a domain as a zone file Returns the domain's DNS records formatted as a BIND-style zone file fragment.
-
#management_get_domain_zone_file_with_http_info(public_id, opts = {}) ⇒ Array<(String, Integer, Hash)>
Download a domain as a zone file Returns the domain's DNS records formatted as a BIND-style zone file fragment.
-
#management_list_domains(opts = {}) ⇒ DomainItemCursorListResponse
List mailbox domains Returns a cursor-paginated list of sending domains configured for the team, ordered by
created_atdescending. -
#management_list_domains_with_http_info(opts = {}) ⇒ Array<(DomainItemCursorListResponse, Integer, Hash)>
List mailbox domains Returns a cursor-paginated list of sending domains configured for the team, ordered by `created_at` descending.
-
#management_update_domain(public_id, opts = {}) ⇒ DomainItemResponse
Update a mailbox domain Upgrades a send-only domain to sending and receiving.
-
#management_update_domain_with_http_info(public_id, opts = {}) ⇒ Array<(DomainItemResponse, Integer, Hash)>
Update a mailbox domain Upgrades a send-only domain to sending and receiving.
-
#management_verify_domain(public_id, opts = {}) ⇒ DomainVerifyResponse
Verify a mailbox domain Runs an immediate DNS-over-HTTPS check of the domain's required DNS records, enables Amazon SES MAIL FROM after its DNS records are present, then asks Amazon SES for the latest DKIM and MAIL FROM statuses.
-
#management_verify_domain_with_http_info(public_id, opts = {}) ⇒ Array<(DomainVerifyResponse, Integer, Hash)>
Verify a mailbox domain Runs an immediate DNS-over-HTTPS check of the domain's required DNS records, enables Amazon SES MAIL FROM after its DNS records are present, then asks Amazon SES for the latest DKIM and MAIL FROM statuses.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ DomainsApi
Returns a new instance of DomainsApi.
19 20 21 |
# File 'lib/sendmux_management_generated/api/domains_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/sendmux_management_generated/api/domains_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#management_create_domain(opts = {}) ⇒ DomainItemResponse
Add a mailbox domain
Creates a new domain and returns the DNS records the customer must place before verification can succeed. send_only configures outbound sending without changing MX records. send_receive also configures the domain for hosted mailboxes. Provisioning touches our email platform and Amazon SES; on any failure the partial state is automatically rolled back. Supply an Idempotency-Key header (any unique string, max 255 chars) to safely retry on network errors. Replays with the same key return the original response; replays with a different body return 409 idempotency_conflict.
28 29 30 31 |
# File 'lib/sendmux_management_generated/api/domains_api.rb', line 28 def management_create_domain(opts = {}) data, _status_code, _headers = management_create_domain_with_http_info(opts) data end |
#management_create_domain_with_http_info(opts = {}) ⇒ Array<(DomainItemResponse, Integer, Hash)>
Add a mailbox domain Creates a new domain and returns the DNS records the customer must place before verification can succeed. `send_only` configures outbound sending without changing MX records. `send_receive` also configures the domain for hosted mailboxes. Provisioning touches our email platform and Amazon SES; on any failure the partial state is automatically rolled back. Supply an `Idempotency-Key` header (any unique string, max 255 chars) to safely retry on network errors. Replays with the same key return the original response; replays with a different body return `409 idempotency_conflict`.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/sendmux_management_generated/api/domains_api.rb', line 39 def management_create_domain_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DomainsApi.management_create_domain ...' end if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255 fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling DomainsApi.management_create_domain, the character length must be smaller than or equal to 255.' end # resource path local_var_path = '/domains' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'management_create_domain_request']) # return_type return_type = opts[:debug_return_type] || 'DomainItemResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"DomainsApi.management_create_domain", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DomainsApi#management_create_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#management_delete_domain(public_id, opts = {}) ⇒ DomainDeletedResponse
Delete a mailbox domain Removes a domain from our mail platform, Amazon SES, and Sendmux. Blocked if any active mailbox still uses the domain — delete those mailboxes first.
98 99 100 101 |
# File 'lib/sendmux_management_generated/api/domains_api.rb', line 98 def management_delete_domain(public_id, opts = {}) data, _status_code, _headers = management_delete_domain_with_http_info(public_id, opts) data end |
#management_delete_domain_with_http_info(public_id, opts = {}) ⇒ Array<(DomainDeletedResponse, Integer, Hash)>
Delete a mailbox domain Removes a domain from our mail platform, Amazon SES, and Sendmux. Blocked if any active mailbox still uses the domain — delete those mailboxes first.
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/sendmux_management_generated/api/domains_api.rb', line 108 def management_delete_domain_with_http_info(public_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DomainsApi.management_delete_domain ...' end # verify the required parameter 'public_id' is set if @api_client.config.client_side_validation && public_id.nil? fail ArgumentError, "Missing the required parameter 'public_id' when calling DomainsApi.management_delete_domain" end # resource path local_var_path = '/domains/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'DomainDeletedResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"DomainsApi.management_delete_domain", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DomainsApi#management_delete_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#management_get_domain(public_id, opts = {}) ⇒ DomainItemResponse
Get a mailbox domain
Returns a single domain including its DNS records and latest verification state. Responses carry a weak ETag header — send it back as If-None-Match on the next request and the server will return 304 Not Modified (no body) when the resource has not changed.
162 163 164 165 |
# File 'lib/sendmux_management_generated/api/domains_api.rb', line 162 def management_get_domain(public_id, opts = {}) data, _status_code, _headers = management_get_domain_with_http_info(public_id, opts) data end |
#management_get_domain_with_http_info(public_id, opts = {}) ⇒ Array<(DomainItemResponse, Integer, Hash)>
Get a mailbox domain Returns a single domain including its DNS records and latest verification state. Responses carry a weak `ETag` header — send it back as `If-None-Match` on the next request and the server will return `304 Not Modified` (no body) when the resource has not changed.
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
# File 'lib/sendmux_management_generated/api/domains_api.rb', line 173 def management_get_domain_with_http_info(public_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DomainsApi.management_get_domain ...' end # verify the required parameter 'public_id' is set if @api_client.config.client_side_validation && public_id.nil? fail ArgumentError, "Missing the required parameter 'public_id' when calling DomainsApi.management_get_domain" end # resource path local_var_path = '/domains/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'DomainItemResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"DomainsApi.management_get_domain", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DomainsApi#management_get_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#management_get_domain_zone_file(public_id, opts = {}) ⇒ String
Download a domain as a zone file Returns the domain's DNS records formatted as a BIND-style zone file fragment. Suitable for direct paste into a DNS provider that accepts zone-file imports.
227 228 229 230 |
# File 'lib/sendmux_management_generated/api/domains_api.rb', line 227 def management_get_domain_zone_file(public_id, opts = {}) data, _status_code, _headers = management_get_domain_zone_file_with_http_info(public_id, opts) data end |
#management_get_domain_zone_file_with_http_info(public_id, opts = {}) ⇒ Array<(String, Integer, Hash)>
Download a domain as a zone file Returns the domain's DNS records formatted as a BIND-style zone file fragment. Suitable for direct paste into a DNS provider that accepts zone-file imports.
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 |
# File 'lib/sendmux_management_generated/api/domains_api.rb', line 237 def management_get_domain_zone_file_with_http_info(public_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DomainsApi.management_get_domain_zone_file ...' end # verify the required parameter 'public_id' is set if @api_client.config.client_side_validation && public_id.nil? fail ArgumentError, "Missing the required parameter 'public_id' when calling DomainsApi.management_get_domain_zone_file" end # resource path local_var_path = '/domains/{public_id}/zone-file'.sub('{public_id}', CGI.escape(public_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'String' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"DomainsApi.management_get_domain_zone_file", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DomainsApi#management_get_domain_zone_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#management_list_domains(opts = {}) ⇒ DomainItemCursorListResponse
List mailbox domains
Returns a cursor-paginated list of sending domains configured for the team, ordered by created_at descending. Each entry includes the DNS records the customer must place, the current verification status, and the SES DKIM state. Pass cursor=<next_cursor> from the previous response to fetch the next page.
291 292 293 294 |
# File 'lib/sendmux_management_generated/api/domains_api.rb', line 291 def management_list_domains(opts = {}) data, _status_code, _headers = management_list_domains_with_http_info(opts) data end |
#management_list_domains_with_http_info(opts = {}) ⇒ Array<(DomainItemCursorListResponse, Integer, Hash)>
List mailbox domains Returns a cursor-paginated list of sending domains configured for the team, ordered by `created_at` descending. Each entry includes the DNS records the customer must place, the current verification status, and the SES DKIM state. Pass `cursor=<next_cursor>` from the previous response to fetch the next page.
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
# File 'lib/sendmux_management_generated/api/domains_api.rb', line 302 def management_list_domains_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DomainsApi.management_list_domains ...' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DomainsApi.management_list_domains, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DomainsApi.management_list_domains, must be greater than or equal to 1.' end # resource path local_var_path = '/domains' # query parameters query_params = opts[:query_params] || {} query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'DomainItemCursorListResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"DomainsApi.management_list_domains", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DomainsApi#management_list_domains\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#management_update_domain(public_id, opts = {}) ⇒ DomainItemResponse
Update a mailbox domain
Upgrades a send-only domain to sending and receiving. Downgrades are rejected. After upgrade, the domain returns to pending until the required MX record verifies.
363 364 365 366 |
# File 'lib/sendmux_management_generated/api/domains_api.rb', line 363 def management_update_domain(public_id, opts = {}) data, _status_code, _headers = management_update_domain_with_http_info(public_id, opts) data end |
#management_update_domain_with_http_info(public_id, opts = {}) ⇒ Array<(DomainItemResponse, Integer, Hash)>
Update a mailbox domain Upgrades a send-only domain to sending and receiving. Downgrades are rejected. After upgrade, the domain returns to `pending` until the required MX record verifies.
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 |
# File 'lib/sendmux_management_generated/api/domains_api.rb', line 375 def management_update_domain_with_http_info(public_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DomainsApi.management_update_domain ...' end # verify the required parameter 'public_id' is set if @api_client.config.client_side_validation && public_id.nil? fail ArgumentError, "Missing the required parameter 'public_id' when calling DomainsApi.management_update_domain" end # resource path local_var_path = '/domains/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'management_update_domain_request']) # return_type return_type = opts[:debug_return_type] || 'DomainItemResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"DomainsApi.management_update_domain", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DomainsApi#management_update_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#management_verify_domain(public_id, opts = {}) ⇒ DomainVerifyResponse
Verify a mailbox domain Runs an immediate DNS-over-HTTPS check of the domain's required DNS records, enables Amazon SES MAIL FROM after its DNS records are present, then asks Amazon SES for the latest DKIM and MAIL FROM statuses. If every required check passes the domain is marked verified. Domains automatically re-verify every 6 hours — this endpoint is only needed to trigger a check on demand.
434 435 436 437 |
# File 'lib/sendmux_management_generated/api/domains_api.rb', line 434 def management_verify_domain(public_id, opts = {}) data, _status_code, _headers = management_verify_domain_with_http_info(public_id, opts) data end |
#management_verify_domain_with_http_info(public_id, opts = {}) ⇒ Array<(DomainVerifyResponse, Integer, Hash)>
Verify a mailbox domain Runs an immediate DNS-over-HTTPS check of the domain's required DNS records, enables Amazon SES MAIL FROM after its DNS records are present, then asks Amazon SES for the latest DKIM and MAIL FROM statuses. If every required check passes the domain is marked verified. Domains automatically re-verify every 6 hours — this endpoint is only needed to trigger a check on demand.
444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 |
# File 'lib/sendmux_management_generated/api/domains_api.rb', line 444 def management_verify_domain_with_http_info(public_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DomainsApi.management_verify_domain ...' end # verify the required parameter 'public_id' is set if @api_client.config.client_side_validation && public_id.nil? fail ArgumentError, "Missing the required parameter 'public_id' when calling DomainsApi.management_verify_domain" end # resource path local_var_path = '/domains/{public_id}/verify'.sub('{public_id}', CGI.escape(public_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'DomainVerifyResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"DomainsApi.management_verify_domain", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DomainsApi#management_verify_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |