Class: Telnyx::Resources::PhoneNumberBlocks::Jobs

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/phone_number_blocks/jobs.rb

Instance Method Summary collapse

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.

Parameters:



87
88
89
# File 'lib/telnyx/resources/phone_number_blocks/jobs.rb', line 87

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.

Parameters:

Returns:

See Also:



73
74
75
76
77
78
79
80
81
82
# File 'lib/telnyx/resources/phone_number_blocks/jobs.rb', line 73

def delete_phone_number_block(params)
  parsed, options = 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: 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.

Lists the phone number blocks jobs

Parameters:

Returns:

See Also:



47
48
49
50
51
52
53
54
55
56
57
# File 'lib/telnyx/resources/phone_number_blocks/jobs.rb', line 47

def list(params = {})
  parsed, options = Telnyx::PhoneNumberBlocks::JobListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "phone_number_blocks/jobs",
    query: parsed.transform_keys(page_number: "page[number]", page_size: "page[size]"),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::PhoneNumberBlocks::Job,
    options: options
  )
end

#retrieve(id, request_options: {}) ⇒ Telnyx::Models::PhoneNumberBlocks::JobRetrieveResponse

Retrieves a phone number blocks job

Parameters:

  • id (String)

    Identifies the Phone Number Blocks Job.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



18
19
20
21
22
23
24
25
# File 'lib/telnyx/resources/phone_number_blocks/jobs.rb', line 18

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