Class: Telnyx::Resources::PhoneNumbers::Jobs
- Inherits:
-
Object
- Object
- Telnyx::Resources::PhoneNumbers::Jobs
- Defined in:
- lib/telnyx/resources/phone_numbers/jobs.rb
Instance Method Summary collapse
-
#delete_batch(phone_numbers:, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::JobDeleteBatchResponse
Creates a new background job to delete a batch of numbers.
-
#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::PhoneNumbers::PhoneNumbersJob>
Some parameter documentations has been truncated, see Models::PhoneNumbers::JobListParams for more details.
-
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::JobRetrieveResponse
Retrieve a phone numbers job.
-
#update_batch(phone_numbers:, filter: nil, billing_group_id: nil, connection_id: nil, customer_reference: nil, deletion_lock_enabled: nil, external_pin: nil, hd_voice_enabled: nil, tags: nil, voice: nil, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::JobUpdateBatchResponse
Some parameter documentations has been truncated, see Models::PhoneNumbers::JobUpdateBatchParams for more details.
-
#update_emergency_settings_batch(emergency_enabled:, phone_numbers:, emergency_address_id: nil, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::JobUpdateEmergencySettingsBatchResponse
Some parameter documentations has been truncated, see Models::PhoneNumbers::JobUpdateEmergencySettingsBatchParams for more details.
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.
168 169 170 |
# File 'lib/telnyx/resources/phone_numbers/jobs.rb', line 168 def initialize(client:) @client = client end |
Instance Method Details
#delete_batch(phone_numbers:, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::JobDeleteBatchResponse
Creates a new background job to delete a batch of numbers. At most one thousand numbers can be updated per API call.
70 71 72 73 74 75 76 77 78 79 |
# File 'lib/telnyx/resources/phone_numbers/jobs.rb', line 70 def delete_batch(params) parsed, = Telnyx::PhoneNumbers::JobDeleteBatchParams.dump_request(params) @client.request( method: :post, path: "phone_numbers/jobs/delete_phone_numbers", body: parsed, model: Telnyx::Models::PhoneNumbers::JobDeleteBatchResponse, options: ) end |
#list(filter: nil, page_number: nil, page_size: nil, sort: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::PhoneNumbers::PhoneNumbersJob>
Some parameter documentations has been truncated, see Models::PhoneNumbers::JobListParams for more details.
Lists the phone numbers jobs
47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/telnyx/resources/phone_numbers/jobs.rb', line 47 def list(params = {}) parsed, = Telnyx::PhoneNumbers::JobListParams.dump_request(params) @client.request( method: :get, path: "phone_numbers/jobs", query: parsed.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::PhoneNumbers::PhoneNumbersJob, options: ) end |
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::JobRetrieveResponse
Retrieve a phone numbers job
18 19 20 21 22 23 24 25 |
# File 'lib/telnyx/resources/phone_numbers/jobs.rb', line 18 def retrieve(id, params = {}) @client.request( method: :get, path: ["phone_numbers/jobs/%1$s", id], model: Telnyx::Models::PhoneNumbers::JobRetrieveResponse, options: params[:request_options] ) end |
#update_batch(phone_numbers:, filter: nil, billing_group_id: nil, connection_id: nil, customer_reference: nil, deletion_lock_enabled: nil, external_pin: nil, hd_voice_enabled: nil, tags: nil, voice: nil, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::JobUpdateBatchResponse
Some parameter documentations has been truncated, see Models::PhoneNumbers::JobUpdateBatchParams for more details.
Creates a new background job to update a batch of numbers. At most one thousand numbers can be updated per API call. At least one of the updateable fields must be submitted. IMPORTANT: You must either specify filters (using the filter parameters) or specific phone numbers (using the phone_numbers parameter in the request body). If you specify filters, ALL phone numbers that match the given filters (up to 1000 at a time) will be updated. If you want to update only specific numbers, you must use the phone_numbers parameter in the request body. When using the phone_numbers parameter, ensure you follow the correct format as shown in the example (either phone number IDs or phone numbers in E164 format).
121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/telnyx/resources/phone_numbers/jobs.rb', line 121 def update_batch(params) parsed, = Telnyx::PhoneNumbers::JobUpdateBatchParams.dump_request(params) query_params = [:filter] @client.request( method: :post, path: "phone_numbers/jobs/update_phone_numbers", query: parsed.slice(*query_params), body: parsed.except(*query_params), model: Telnyx::Models::PhoneNumbers::JobUpdateBatchResponse, options: ) end |
#update_emergency_settings_batch(emergency_enabled:, phone_numbers:, emergency_address_id: nil, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::JobUpdateEmergencySettingsBatchResponse
Some parameter documentations has been truncated, see Models::PhoneNumbers::JobUpdateEmergencySettingsBatchParams for more details.
Creates a background job to update the emergency settings of a collection of phone numbers. At most one thousand numbers can be updated per API call.
154 155 156 157 158 159 160 161 162 163 |
# File 'lib/telnyx/resources/phone_numbers/jobs.rb', line 154 def update_emergency_settings_batch(params) parsed, = Telnyx::PhoneNumbers::JobUpdateEmergencySettingsBatchParams.dump_request(params) @client.request( method: :post, path: "phone_numbers/jobs/update_emergency_settings", body: parsed, model: Telnyx::Models::PhoneNumbers::JobUpdateEmergencySettingsBatchResponse, options: ) end |