Class: Telnyx::Resources::EmailBlocks::Import
- Inherits:
-
Object
- Object
- Telnyx::Resources::EmailBlocks::Import
- Defined in:
- lib/telnyx/resources/email_blocks/import.rb,
sig/telnyx/resources/email_blocks/import.rbs
Overview
Async CSV import of competitor suppression lists.
Instance Method Summary collapse
-
#create(file:, block_ttl_days: nil, request_options: {}) ⇒ Telnyx::Models::EmailBlocks::EmailBlockImportResponse
Some parameter documentations has been truncated, see Models::EmailBlocks::ImportCreateParams for more details.
-
#initialize(client:) ⇒ Import
constructor
private
A new instance of Import.
-
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::EmailBlocks::EmailBlockImportResponse
Account-scoped fetch (cross-account → 404; malformed UUID → 404).
Constructor Details
#initialize(client:) ⇒ Import
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 Import.
73 74 75 |
# File 'lib/telnyx/resources/email_blocks/import.rb', line 73 def initialize(client:) @client = client end |
Instance Method Details
#create(file:, block_ttl_days: nil, request_options: {}) ⇒ Telnyx::Models::EmailBlocks::EmailBlockImportResponse
Some parameter documentations has been truncated, see Models::EmailBlocks::ImportCreateParams for more details.
Accepts multipart/form-data with a file field (the CSV) and an optional
block_ttl_days (integer >0, default 30). Validates:
- content ≤ 25 MiB, else
413 - row count ≤ 250 000, else
413 - header-only / all-blank / undetectable provider →
400Returns202with the import record (statuspending); an Oban worker (EmailBlockImportWorker, max_attempts 3) transitionspending → processing → completed | failed.block_ttl_daysapplies only to importedmanual_blockrows; other reasons getexpires_at: nil. Provider is auto-detected from the CSV header (sendgrid/mailgun/ses/generic).
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/telnyx/resources/email_blocks/import.rb', line 34 def create(params) parsed, = Telnyx::EmailBlocks::ImportCreateParams.dump_request(params) @client.request( method: :post, path: "email_blocks/import", headers: {"content-type" => "multipart/form-data"}, body: parsed, model: Telnyx::EmailBlocks::EmailBlockImportResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::EmailBlocks::EmailBlockImportResponse
Account-scoped fetch (cross-account → 404; malformed UUID → 404). Nullable
fields are omitted until terminal: provider/completed_at when nil;
processed_rows/created_count/existing_count/ skipped_count/error_count
only when status == completed; errors only when non-empty; failure_reason
only on terminal failure.
61 62 63 64 65 66 67 68 |
# File 'lib/telnyx/resources/email_blocks/import.rb', line 61 def retrieve(id, params = {}) @client.request( method: :get, path: ["email_blocks/import/%1$s", id], model: Telnyx::EmailBlocks::EmailBlockImportResponse, options: params[:request_options] ) end |