Class: Telnyx::Resources::PhoneNumberBlocks::Jobs
- Inherits:
-
Object
- Object
- Telnyx::Resources::PhoneNumberBlocks::Jobs
- Defined in:
- lib/telnyx/resources/phone_number_blocks/jobs.rb,
sig/telnyx/resources/phone_number_blocks/jobs.rbs
Overview
Background jobs performed over a phone-numbers block's phone numbers
Instance Method Summary collapse
-
#delete_phone_number_block(phone_number_block_id:, request_options: {}) ⇒ Telnyx::Models::PhoneNumberBlocks::JobDeletePhoneNumberBlockResponse
Creates a new background job to delete all the phone numbers associated with the given block.
-
#initialize(client:) ⇒ Jobs
constructor
private
A new instance of Jobs.
-
#list(filter: nil, page_number: nil, page_size: nil, sort: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::PhoneNumberBlocks::Job>
Some parameter documentations has been truncated, see Models::PhoneNumberBlocks::JobListParams for more details.
-
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::PhoneNumberBlocks::JobRetrieveResponse
Returns the status and details of the phone-number-block background job identified by
id.
Constructor Details
#initialize(client:) ⇒ Jobs
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 Jobs.
92 93 94 |
# File 'lib/telnyx/resources/phone_number_blocks/jobs.rb', line 92 def initialize(client:) @client = client end |
Instance Method Details
#delete_phone_number_block(phone_number_block_id:, request_options: {}) ⇒ Telnyx::Models::PhoneNumberBlocks::JobDeletePhoneNumberBlockResponse
Creates a new background job to delete all the phone numbers associated with the given block. We will only consider the phone number block as deleted after all phone numbers associated with it are removed, so multiple executions of this job may be necessary in case some of the phone numbers present errors during the deletion process.
78 79 80 81 82 83 84 85 86 87 |
# File 'lib/telnyx/resources/phone_number_blocks/jobs.rb', line 78 def delete_phone_number_block(params) parsed, = Telnyx::PhoneNumberBlocks::JobDeletePhoneNumberBlockParams.dump_request(params) @client.request( method: :post, path: "phone_number_blocks/jobs/delete_phone_number_block", body: parsed, model: Telnyx::Models::PhoneNumberBlocks::JobDeletePhoneNumberBlockResponse, options: ) end |
#list(filter: nil, page_number: nil, page_size: nil, sort: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::PhoneNumberBlocks::Job>
Some parameter documentations has been truncated, see Models::PhoneNumberBlocks::JobListParams for more details.
Returns background jobs that operate on phone-number blocks. Results can be filtered by job type and status, sorted by creation time, and include pagination metadata.
51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/telnyx/resources/phone_number_blocks/jobs.rb', line 51 def list(params = {}) parsed, = Telnyx::PhoneNumberBlocks::JobListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "phone_number_blocks/jobs", query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::PhoneNumberBlocks::Job, options: ) end |
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::PhoneNumberBlocks::JobRetrieveResponse
Returns the status and details of the phone-number-block background job
identified by id.
20 21 22 23 24 25 26 27 |
# File 'lib/telnyx/resources/phone_number_blocks/jobs.rb', line 20 def retrieve(id, params = {}) @client.request( method: :get, path: ["phone_number_blocks/jobs/%1$s", id], model: Telnyx::Models::PhoneNumberBlocks::JobRetrieveResponse, options: params[:request_options] ) end |