Class: Telnyx::Resources::EmailValidations::Batch
- Inherits:
-
Object
- Object
- Telnyx::Resources::EmailValidations::Batch
- Defined in:
- lib/telnyx/resources/email_validations/batch.rb,
sig/telnyx/resources/email_validations/batch.rbs
Overview
Validate email addresses synchronously or in asynchronous batches.
Instance Method Summary collapse
-
#create(emails:, webhook_url: nil, idempotency_key: nil, request_options: {}) ⇒ Telnyx::Models::EmailValidations::BatchCreateResponse
Some parameter documentations has been truncated, see Models::EmailValidations::BatchCreateParams for more details.
-
#initialize(client:) ⇒ Batch
constructor
private
A new instance of Batch.
-
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::EmailValidations::BatchRetrieveResponse
Retrieves the current status and, once completed, validation results for a batch job.
Constructor Details
#initialize(client:) ⇒ Batch
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 Batch.
63 64 65 |
# File 'lib/telnyx/resources/email_validations/batch.rb', line 63 def initialize(client:) @client = client end |
Instance Method Details
#create(emails:, webhook_url: nil, idempotency_key: nil, request_options: {}) ⇒ Telnyx::Models::EmailValidations::BatchCreateResponse
Some parameter documentations has been truncated, see Models::EmailValidations::BatchCreateParams for more details.
Creates an asynchronous batch validation job for up to 1,000 email addresses.
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/telnyx/resources/email_validations/batch.rb', line 26 def create(params) parsed, = Telnyx::EmailValidations::BatchCreateParams.dump_request(params) header_params = {idempotency_key: "idempotency-key"} @client.request( method: :post, path: "email_validations/batch", headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Telnyx::Models::EmailValidations::BatchCreateResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::EmailValidations::BatchRetrieveResponse
Retrieves the current status and, once completed, validation results for a batch job.
51 52 53 54 55 56 57 58 |
# File 'lib/telnyx/resources/email_validations/batch.rb', line 51 def retrieve(id, params = {}) @client.request( method: :get, path: ["email_validations/batch/%1$s", id], model: Telnyx::Models::EmailValidations::BatchRetrieveResponse, options: params[:request_options] ) end |