Class: Telnyx::Resources::PortingOrders

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/porting_orders.rb,
lib/telnyx/resources/porting_orders/actions.rb,
lib/telnyx/resources/porting_orders/comments.rb,
lib/telnyx/resources/porting_orders/activation_jobs.rb,
lib/telnyx/resources/porting_orders/verification_codes.rb,
lib/telnyx/resources/porting_orders/action_requirements.rb,
lib/telnyx/resources/porting_orders/phone_number_blocks.rb,
lib/telnyx/resources/porting_orders/additional_documents.rb,
lib/telnyx/resources/porting_orders/phone_number_extensions.rb,
lib/telnyx/resources/porting_orders/associated_phone_numbers.rb,
lib/telnyx/resources/porting_orders/phone_number_configurations.rb

Overview

Endpoints related to porting orders management.

Defined Under Namespace

Classes: ActionRequirements, Actions, ActivationJobs, AdditionalDocuments, AssociatedPhoneNumbers, Comments, PhoneNumberBlocks, PhoneNumberConfigurations, PhoneNumberExtensions, VerificationCodes

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ PortingOrders

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 PortingOrders.

Parameters:



330
331
332
333
334
335
336
337
338
339
340
341
342
343
# File 'lib/telnyx/resources/porting_orders.rb', line 330

def initialize(client:)
  @client = client
  @phone_number_configurations =
    Telnyx::Resources::PortingOrders::PhoneNumberConfigurations.new(client: client)
  @actions = Telnyx::Resources::PortingOrders::Actions.new(client: client)
  @activation_jobs = Telnyx::Resources::PortingOrders::ActivationJobs.new(client: client)
  @additional_documents = Telnyx::Resources::PortingOrders::AdditionalDocuments.new(client: client)
  @comments = Telnyx::Resources::PortingOrders::Comments.new(client: client)
  @verification_codes = Telnyx::Resources::PortingOrders::VerificationCodes.new(client: client)
  @action_requirements = Telnyx::Resources::PortingOrders::ActionRequirements.new(client: client)
  @associated_phone_numbers = Telnyx::Resources::PortingOrders::AssociatedPhoneNumbers.new(client: client)
  @phone_number_blocks = Telnyx::Resources::PortingOrders::PhoneNumberBlocks.new(client: client)
  @phone_number_extensions = Telnyx::Resources::PortingOrders::PhoneNumberExtensions.new(client: client)
end

Instance Attribute Details

#action_requirementsTelnyx::Resources::PortingOrders::ActionRequirements (readonly)

Endpoints related to porting orders management.



33
34
35
# File 'lib/telnyx/resources/porting_orders.rb', line 33

def action_requirements
  @action_requirements
end

#actionsTelnyx::Resources::PortingOrders::Actions (readonly)

Endpoints related to porting orders management.



13
14
15
# File 'lib/telnyx/resources/porting_orders.rb', line 13

def actions
  @actions
end

#activation_jobsTelnyx::Resources::PortingOrders::ActivationJobs (readonly)

Endpoints related to porting orders management.



17
18
19
# File 'lib/telnyx/resources/porting_orders.rb', line 17

def activation_jobs
  @activation_jobs
end

#additional_documentsTelnyx::Resources::PortingOrders::AdditionalDocuments (readonly)

Endpoints related to porting orders management.



21
22
23
# File 'lib/telnyx/resources/porting_orders.rb', line 21

def additional_documents
  @additional_documents
end

#associated_phone_numbersTelnyx::Resources::PortingOrders::AssociatedPhoneNumbers (readonly)

Endpoints related to porting orders management.



37
38
39
# File 'lib/telnyx/resources/porting_orders.rb', line 37

def associated_phone_numbers
  @associated_phone_numbers
end

#commentsTelnyx::Resources::PortingOrders::Comments (readonly)

Endpoints related to porting orders management.



25
26
27
# File 'lib/telnyx/resources/porting_orders.rb', line 25

def comments
  @comments
end

#phone_number_blocksTelnyx::Resources::PortingOrders::PhoneNumberBlocks (readonly)

Endpoints related to porting orders management.



41
42
43
# File 'lib/telnyx/resources/porting_orders.rb', line 41

def phone_number_blocks
  @phone_number_blocks
end

#phone_number_configurationsTelnyx::Resources::PortingOrders::PhoneNumberConfigurations (readonly)

Endpoints related to porting orders management.



9
10
11
# File 'lib/telnyx/resources/porting_orders.rb', line 9

def phone_number_configurations
  @phone_number_configurations
end

#phone_number_extensionsTelnyx::Resources::PortingOrders::PhoneNumberExtensions (readonly)

Endpoints related to porting orders management.



45
46
47
# File 'lib/telnyx/resources/porting_orders.rb', line 45

def phone_number_extensions
  @phone_number_extensions
end

#verification_codesTelnyx::Resources::PortingOrders::VerificationCodes (readonly)

Endpoints related to porting orders management.



29
30
31
# File 'lib/telnyx/resources/porting_orders.rb', line 29

def verification_codes
  @verification_codes
end

Instance Method Details

#create(phone_numbers:, customer_group_reference: nil, customer_reference: nil, request_options: {}) ⇒ Telnyx::Models::PortingOrderCreateResponse

Creates a new porting order object.

Parameters:

  • phone_numbers (Array<String>)

    The list of +E.164 formatted phone numbers

  • customer_group_reference (String)

    A customer-specified group reference for customer bookkeeping purposes

  • customer_reference (String, nil)

    A customer-specified reference number for customer bookkeeping purposes

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

Returns:

See Also:



62
63
64
65
66
67
68
69
70
71
# File 'lib/telnyx/resources/porting_orders.rb', line 62

def create(params)
  parsed, options = Telnyx::PortingOrderCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "porting_orders",
    body: parsed,
    model: Telnyx::Models::PortingOrderCreateResponse,
    options: options
  )
end

#delete(id, request_options: {}) ⇒ nil

Deletes an existing porting order. This operation is restrict to porting orders in draft state.

Parameters:

Returns:

  • (nil)

See Also:



202
203
204
205
206
207
208
209
# File 'lib/telnyx/resources/porting_orders.rb', line 202

def delete(id, params = {})
  @client.request(
    method: :delete,
    path: ["porting_orders/%1$s", id],
    model: NilClass,
    options: params[:request_options]
  )
end

#list(filter: nil, include_phone_numbers: nil, page_number: nil, page_size: nil, sort: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::PortingOrder>

Some parameter documentations has been truncated, see Models::PortingOrderListParams for more details.

Returns a list of your porting order.

Parameters:

Returns:

See Also:



177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/telnyx/resources/porting_orders.rb', line 177

def list(params = {})
  parsed, options = Telnyx::PortingOrderListParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "porting_orders",
    query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::PortingOrder,
    options: options
  )
end

#retrieve(id, include_phone_numbers: nil, request_options: {}) ⇒ Telnyx::Models::PortingOrderRetrieveResponse

Retrieves the details of an existing porting order.

Parameters:

  • id (String)

    Porting Order id

  • include_phone_numbers (Boolean)

    Include the first 50 phone number objects in the results

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

Returns:

See Also:



86
87
88
89
90
91
92
93
94
95
96
# File 'lib/telnyx/resources/porting_orders.rb', line 86

def retrieve(id, params = {})
  parsed, options = Telnyx::PortingOrderRetrieveParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["porting_orders/%1$s", id],
    query: query,
    model: Telnyx::Models::PortingOrderRetrieveResponse,
    options: options
  )
end

#retrieve_allowed_foc_windows(id, request_options: {}) ⇒ Telnyx::Models::PortingOrderRetrieveAllowedFocWindowsResponse

Returns a list of allowed FOC dates for a porting order.

Parameters:

Returns:

See Also:



222
223
224
225
226
227
228
229
# File 'lib/telnyx/resources/porting_orders.rb', line 222

def retrieve_allowed_foc_windows(id, params = {})
  @client.request(
    method: :get,
    path: ["porting_orders/%1$s/allowed_foc_windows", id],
    model: Telnyx::Models::PortingOrderRetrieveAllowedFocWindowsResponse,
    options: params[:request_options]
  )
end

#retrieve_exception_types(request_options: {}) ⇒ Telnyx::Models::PortingOrderRetrieveExceptionTypesResponse

Returns a list of all possible exception types for a porting order.



240
241
242
243
244
245
246
247
# File 'lib/telnyx/resources/porting_orders.rb', line 240

def retrieve_exception_types(params = {})
  @client.request(
    method: :get,
    path: "porting_orders/exception_types",
    model: Telnyx::Models::PortingOrderRetrieveExceptionTypesResponse,
    options: params[:request_options]
  )
end

#retrieve_loa_template(id, loa_configuration_id: nil, request_options: {}) ⇒ StringIO

Some parameter documentations has been truncated, see Models::PortingOrderRetrieveLoaTemplateParams for more details.

Download a porting order loa template

Parameters:

  • id (String)

    Porting Order id

  • loa_configuration_id (String)

    The identifier of the LOA configuration to use for the template. If not provided

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

Returns:

  • (StringIO)

See Also:



265
266
267
268
269
270
271
272
273
274
275
276
# File 'lib/telnyx/resources/porting_orders.rb', line 265

def retrieve_loa_template(id, params = {})
  parsed, options = Telnyx::PortingOrderRetrieveLoaTemplateParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["porting_orders/%1$s/loa_template", id],
    query: query,
    headers: {"accept" => "application/pdf"},
    model: StringIO,
    options: options
  )
end

#retrieve_requirements(id, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::PortingOrderRetrieveRequirementsResponse>

Returns a list of all requirements based on country/number type for this porting order.

Parameters:

  • id (String)

    Porting Order id

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

Returns:

See Also:



294
295
296
297
298
299
300
301
302
303
304
305
# File 'lib/telnyx/resources/porting_orders.rb', line 294

def retrieve_requirements(id, params = {})
  parsed, options = Telnyx::PortingOrderRetrieveRequirementsParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["porting_orders/%1$s/requirements", id],
    query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::Models::PortingOrderRetrieveRequirementsResponse,
    options: options
  )
end

#retrieve_sub_request(id, request_options: {}) ⇒ Telnyx::Models::PortingOrderRetrieveSubRequestResponse

Retrieve the associated V1 sub_request_id and port_request_id

Parameters:

Returns:

See Also:



318
319
320
321
322
323
324
325
# File 'lib/telnyx/resources/porting_orders.rb', line 318

def retrieve_sub_request(id, params = {})
  @client.request(
    method: :get,
    path: ["porting_orders/%1$s/sub_request", id],
    model: Telnyx::Models::PortingOrderRetrieveSubRequestResponse,
    options: params[:request_options]
  )
end

#update(id, activation_settings: nil, customer_group_reference: nil, customer_reference: nil, documents: nil, end_user: nil, messaging: nil, misc: nil, phone_number_configuration: nil, requirement_group_id: nil, requirements: nil, user_feedback: nil, webhook_url: nil, request_options: {}) ⇒ Telnyx::Models::PortingOrderUpdateResponse

Some parameter documentations has been truncated, see Models::PortingOrderUpdateParams for more details.

Edits the details of an existing porting order.

Any or all of a porting orders attributes may be included in the resource object included in a PATCH request.

If a request does not include all of the attributes for a resource, the system will interpret the missing attributes as if they were included with their current values. To explicitly set something to null, it must be included in the request with a null value.

Parameters:

Returns:

See Also:



144
145
146
147
148
149
150
151
152
153
# File 'lib/telnyx/resources/porting_orders.rb', line 144

def update(id, params = {})
  parsed, options = Telnyx::PortingOrderUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["porting_orders/%1$s", id],
    body: parsed,
    model: Telnyx::Models::PortingOrderUpdateResponse,
    options: options
  )
end