Class: Zernio::PhoneNumbersApi

Inherits:
Object
  • Object
show all
Defined in:
lib/zernio-sdk/api/phone_numbers_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ PhoneNumbersApi

Returns a new instance of PhoneNumbersApi.



19
20
21
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#cancel_phone_number_port_in(id, opts = {}) ⇒ CancelPhoneNumberPortIn200Response

Cancel a port-in Cancel an in-flight port (wrong number, staying with the old carrier). Only orders that haven't ported can be cancelled; a completed port is a normal number release instead. The carrier may report cancel-pending briefly while the losing carrier acknowledges; it settles to cancelled.

Parameters:

  • id (String)

    Porting order ID (from the port-in list).

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 27

def cancel_phone_number_port_in(id, opts = {})
  data, _status_code, _headers = cancel_phone_number_port_in_with_http_info(id, opts)
  data
end

#cancel_phone_number_port_in_with_http_info(id, opts = {}) ⇒ Array<(CancelPhoneNumberPortIn200Response, Integer, Hash)>

Cancel a port-in Cancel an in-flight port (wrong number, staying with the old carrier). Only orders that haven't ported can be cancelled; a completed port is a normal number release instead. The carrier may report `cancel-pending` briefly while the losing carrier acknowledges; it settles to `cancelled`.

Parameters:

  • id (String)

    Porting order ID (from the port-in list).

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 37

def cancel_phone_number_port_in_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.cancel_phone_number_port_in ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling PhoneNumbersApi.cancel_phone_number_port_in"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/port-in/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CancelPhoneNumberPortIn200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.cancel_phone_number_port_in",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#cancel_phone_number_port_in\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#check_phone_number_availability(country, opts = {}) ⇒ CheckPhoneNumberAvailability200Response

Check country availability Pre-purchase check, so you can warn BEFORE a customer invests in KYC (regulated review is async, 1-3 days). Tells you whether we have deliverable inventory, and what address the customer needs: - addressConstraint: geo → the registered address MUST be in one of the returned areas (the only place we have stock). A different-area address passes pre-approval but the number can never be assigned. - addressConstraint: country → any in-country address works. - addressConstraint: none → field-only / instant country, no address. Call this before starting the KYC form for regulated countries.

Parameters:

  • country (String)

    ISO-2 country code.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :number_type (String)

    Check a specific offered type (stock and address constraints are per type). Omitted = the country's default type.

  • :sms (Boolean)

    Pass true when the buyer wants SMS: availability, areas, and areaOptions then describe the SMS-capable pool (an SMS purchase orders from it), not the wider voice-only pool.

Returns:



92
93
94
95
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 92

def check_phone_number_availability(country, opts = {})
  data, _status_code, _headers = check_phone_number_availability_with_http_info(country, opts)
  data
end

#check_phone_number_availability_with_http_info(country, opts = {}) ⇒ Array<(CheckPhoneNumberAvailability200Response, Integer, Hash)>

Check country availability Pre-purchase check, so you can warn BEFORE a customer invests in KYC (regulated review is async, 1-3 days). Tells you whether we have deliverable inventory, and what address the customer needs: - `addressConstraint: geo` → the registered address MUST be in one of the returned `areas` (the only place we have stock). A different-area address passes pre-approval but the number can never be assigned. - `addressConstraint: country` → any in-country address works. - `addressConstraint: none` → field-only / instant country, no address. Call this before starting the KYC form for regulated countries.

Parameters:

  • country (String)

    ISO-2 country code.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :number_type (String)

    Check a specific offered type (stock and address constraints are per type). Omitted = the country's default type.

  • :sms (Boolean)

    Pass true when the buyer wants SMS: availability, areas, and areaOptions then describe the SMS-capable pool (an SMS purchase orders from it), not the wider voice-only pool.

Returns:



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 104

def check_phone_number_availability_with_http_info(country, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.check_phone_number_availability ...'
  end
  # verify the required parameter 'country' is set
  if @api_client.config.client_side_validation && country.nil?
    fail ArgumentError, "Missing the required parameter 'country' when calling PhoneNumbersApi.check_phone_number_availability"
  end
  allowable_values = ["local", "mobile", "national", "toll_free"]
  if @api_client.config.client_side_validation && opts[:'number_type'] && !allowable_values.include?(opts[:'number_type'])
    fail ArgumentError, "invalid value for \"number_type\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/availability'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'country'] = country
  query_params[:'numberType'] = opts[:'number_type'] if !opts[:'number_type'].nil?
  query_params[:'sms'] = opts[:'sms'] if !opts[:'sms'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CheckPhoneNumberAvailability200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.check_phone_number_availability",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#check_phone_number_availability\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#check_phone_number_portability(check_phone_number_portability_request, opts = {}) ⇒ CheckPhoneNumberPortability200Response

Check portability Pre-flight portability check: whether each number can be ported in and whether it qualifies for FastPort, BEFORE the user commits to a port order (LOA, invoice, service address). Read-only; creates no order and bills nothing.

Parameters:

Returns:



164
165
166
167
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 164

def check_phone_number_portability(check_phone_number_portability_request, opts = {})
  data, _status_code, _headers = check_phone_number_portability_with_http_info(check_phone_number_portability_request, opts)
  data
end

#check_phone_number_portability_with_http_info(check_phone_number_portability_request, opts = {}) ⇒ Array<(CheckPhoneNumberPortability200Response, Integer, Hash)>

Check portability Pre-flight portability check: whether each number can be ported in and whether it qualifies for FastPort, BEFORE the user commits to a port order (LOA, invoice, service address). Read-only; creates no order and bills nothing.

Parameters:

Returns:



174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 174

def check_phone_number_portability_with_http_info(check_phone_number_portability_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.check_phone_number_portability ...'
  end
  # verify the required parameter 'check_phone_number_portability_request' is set
  if @api_client.config.client_side_validation && check_phone_number_portability_request.nil?
    fail ArgumentError, "Missing the required parameter 'check_phone_number_portability_request' when calling PhoneNumbersApi.check_phone_number_portability"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/port-in/check'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(check_phone_number_portability_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CheckPhoneNumberPortability200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.check_phone_number_portability",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#check_phone_number_portability\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Create a hosted KYC link Create a single-use, 7-day hosted KYC link that your end customer completes WITHOUT a Zernio login — useful when the person who holds the ID and address is not your team. They fill the regulated verification on a Zernio-hosted page; the number provisions under YOUR account once they submit. Only regulated (KYC) countries are valid: a country that does not require KYC returns 400. White-label the page with branding (your company name, logo, brand color). Supply redirect_url to send the end customer back to your own site after a successful submit (completion params are appended — see below). Listen for the whatsapp.number.kyc_submitted webhook to react when the form is completed.

Parameters:

Returns:



232
233
234
235
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 232

def create_phone_number_kyc_link(create_phone_number_kyc_link_request, opts = {})
  data, _status_code, _headers = create_phone_number_kyc_link_with_http_info(create_phone_number_kyc_link_request, opts)
  data
end

Create a hosted KYC link Create a single-use, 7-day hosted KYC link that your end customer completes WITHOUT a Zernio login — useful when the person who holds the ID and address is not your team. They fill the regulated verification on a Zernio-hosted page; the number provisions under YOUR account once they submit. Only regulated (KYC) countries are valid: a country that does not require KYC returns 400. White-label the page with `branding` (your company name, logo, brand color). Supply `redirect_url` to send the end customer back to your own site after a successful submit (completion params are appended — see below). Listen for the `whatsapp.number.kyc_submitted` webhook to react when the form is completed.

Parameters:

Returns:



242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 242

def create_phone_number_kyc_link_with_http_info(create_phone_number_kyc_link_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.create_phone_number_kyc_link ...'
  end
  # verify the required parameter 'create_phone_number_kyc_link_request' is set
  if @api_client.config.client_side_validation && create_phone_number_kyc_link_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_phone_number_kyc_link_request' when calling PhoneNumbersApi.create_phone_number_kyc_link"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/kyc/share'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_phone_number_kyc_link_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreatePhoneNumberKycLink200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.create_phone_number_kyc_link",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#create_phone_number_kyc_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_phone_number_port_in(create_phone_number_port_in_request, opts = {}) ⇒ CreatePhoneNumberPortIn201Response

Port numbers in Submit a port-in for one or more existing numbers from another carrier. Creates the carrier order(s), attaches the end-user (current account) info plus the LOA and invoice documents, and submits to the losing carrier. The transfer PIN is forwarded to the carrier and never stored. Ported numbers arrive voice-ready (and SMS-ready where the order supports messaging). Run the portability check (POST /v1/phone-numbers/port-in/check) and upload the two documents (POST /v1/phone-numbers/port-in/documents) first — uploaded documents must be attached to an order within 30 minutes or the carrier deletes them, so upload right before this call. The carrier may split the numbers into several orders (by country, number type, losing carrier); orders carries per-order results, and a partial failure still returns 201 with the failed orders' error set (they stay as cancellable drafts). Non-US/CA numbers additionally need the country-specific values from GET /v1/phone-numbers/port-in/requirements, passed via requirements, and must be submitted one country per request. When required information is still missing after submission, the order is kept as a resumable draft whose error / declineReason names the gaps.

Parameters:

Returns:



300
301
302
303
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 300

def create_phone_number_port_in(create_phone_number_port_in_request, opts = {})
  data, _status_code, _headers = create_phone_number_port_in_with_http_info(create_phone_number_port_in_request, opts)
  data
end

#create_phone_number_port_in_with_http_info(create_phone_number_port_in_request, opts = {}) ⇒ Array<(CreatePhoneNumberPortIn201Response, Integer, Hash)>

Port numbers in Submit a port-in for one or more existing numbers from another carrier. Creates the carrier order(s), attaches the end-user (current account) info plus the LOA and invoice documents, and submits to the losing carrier. The transfer PIN is forwarded to the carrier and never stored. Ported numbers arrive voice-ready (and SMS-ready where the order supports messaging). Run the portability check (POST /v1/phone-numbers/port-in/check) and upload the two documents (POST /v1/phone-numbers/port-in/documents) first — uploaded documents must be attached to an order within 30 minutes or the carrier deletes them, so upload right before this call. The carrier may split the numbers into several orders (by country, number type, losing carrier); `orders` carries per-order results, and a partial failure still returns 201 with the failed orders' `error` set (they stay as cancellable drafts). Non-US/CA numbers additionally need the country-specific values from GET /v1/phone-numbers/port-in/requirements, passed via `requirements`, and must be submitted one country per request. When required information is still missing after submission, the order is kept as a resumable draft whose `error` / `declineReason` names the gaps.

Parameters:

Returns:



310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 310

def create_phone_number_port_in_with_http_info(create_phone_number_port_in_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.create_phone_number_port_in ...'
  end
  # verify the required parameter 'create_phone_number_port_in_request' is set
  if @api_client.config.client_side_validation && create_phone_number_port_in_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_phone_number_port_in_request' when calling PhoneNumbersApi.create_phone_number_port_in"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/port-in'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_phone_number_port_in_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreatePhoneNumberPortIn201Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.create_phone_number_port_in",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#create_phone_number_port_in\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_phone_number(id, opts = {}) ⇒ GetPhoneNumber200Response

Get phone number Retrieve the current status of a purchased phone number. Poll this to track Meta pre-verification (US sync path) and, for regulated (Tier 3/4) numbers, the async lifecycle: pending_regulatory → active (or regulatory_declined). When a regulated number has an Onfido ID step, onfidoVerificationUrl appears here once the order is placed — forward it to the end user. (Or subscribe to the whatsapp.number.* webhooks instead of polling.)

Parameters:

  • id (String)

    Phone number record ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



368
369
370
371
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 368

def get_phone_number(id, opts = {})
  data, _status_code, _headers = get_phone_number_with_http_info(id, opts)
  data
end

#get_phone_number_kyc_form(country, opts = {}) ⇒ GetPhoneNumberKycForm200Response

Get KYC form spec For a Tier 3/4 country, the fields the end customer must provide (Telnyx regulatory requirements) before a number can be ordered: text, date, address, or file (document) per requirement.

Parameters:

  • country (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :number_type (String)

    Requirements and reuse eligibility are per (country, type). Omitted = the country's default type. Pass the same value on the POST.

Returns:



432
433
434
435
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 432

def get_phone_number_kyc_form(country, opts = {})
  data, _status_code, _headers = get_phone_number_kyc_form_with_http_info(country, opts)
  data
end

#get_phone_number_kyc_form_with_http_info(country, opts = {}) ⇒ Array<(GetPhoneNumberKycForm200Response, Integer, Hash)>

Get KYC form spec For a Tier 3/4 country, the fields the end customer must provide (Telnyx regulatory requirements) before a number can be ordered: text, date, address, or file (document) per requirement.

Parameters:

  • country (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :number_type (String)

    Requirements and reuse eligibility are per (country, type). Omitted = the country's default type. Pass the same value on the POST.

Returns:



443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 443

def get_phone_number_kyc_form_with_http_info(country, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.get_phone_number_kyc_form ...'
  end
  # verify the required parameter 'country' is set
  if @api_client.config.client_side_validation && country.nil?
    fail ArgumentError, "Missing the required parameter 'country' when calling PhoneNumbersApi.get_phone_number_kyc_form"
  end
  allowable_values = ["local", "mobile", "national", "toll_free"]
  if @api_client.config.client_side_validation && opts[:'number_type'] && !allowable_values.include?(opts[:'number_type'])
    fail ArgumentError, "invalid value for \"number_type\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/kyc'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'country'] = country
  query_params[:'numberType'] = opts[:'number_type'] if !opts[:'number_type'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetPhoneNumberKycForm200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.get_phone_number_kyc_form",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#get_phone_number_kyc_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_phone_number_port_in_order_requirements(id, opts = {}) ⇒ GetPhoneNumberPortInOrderRequirements200Response

A port-in order's pending requirements The live requirements on an EXISTING porting order: which are filled, which are still pending, and which bounced on review (requirement-info-exception). Use it to fix and resubmit a rejected international port. Same field shape as the country-level requirements endpoint, plus per-requirement status.

Parameters:

  • id (String)

    Porting order ID (from the port-in list).

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



502
503
504
505
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 502

def get_phone_number_port_in_order_requirements(id, opts = {})
  data, _status_code, _headers = get_phone_number_port_in_order_requirements_with_http_info(id, opts)
  data
end

#get_phone_number_port_in_order_requirements_with_http_info(id, opts = {}) ⇒ Array<(GetPhoneNumberPortInOrderRequirements200Response, Integer, Hash)>

A port-in order's pending requirements The live requirements on an EXISTING porting order: which are filled, which are still pending, and which bounced on review (`requirement-info-exception`). Use it to fix and resubmit a rejected international port. Same field shape as the country-level requirements endpoint, plus per-requirement status.

Parameters:

  • id (String)

    Porting order ID (from the port-in list).

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 512

def get_phone_number_port_in_order_requirements_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.get_phone_number_port_in_order_requirements ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling PhoneNumbersApi.get_phone_number_port_in_order_requirements"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/port-in/{id}/requirements'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetPhoneNumberPortInOrderRequirements200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.get_phone_number_port_in_order_requirements",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#get_phone_number_port_in_order_requirements\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_phone_number_port_in_requirements(country, opts = {}) ⇒ GetPhoneNumberPortInRequirements200Response

Country porting requirements The country-specific information a port-in needs BEYOND the LOA, invoice, and account/address details — e.g. an ID copy, proof of address, a tax id, or a porting code. Call it after the portability check (which returns each number's countryCode and phoneNumberType), render the fields, and pass the collected values as the create request's requirements. US/CA return an empty list.

Parameters:

  • country (String)

    ISO country of the numbers being ported (a supported port-in country).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :number_type (String)

    The portability check's phoneNumberType — requirements differ by type. (default to 'local')

Returns:



566
567
568
569
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 566

def get_phone_number_port_in_requirements(country, opts = {})
  data, _status_code, _headers = get_phone_number_port_in_requirements_with_http_info(country, opts)
  data
end

#get_phone_number_port_in_requirements_with_http_info(country, opts = {}) ⇒ Array<(GetPhoneNumberPortInRequirements200Response, Integer, Hash)>

Country porting requirements The country-specific information a port-in needs BEYOND the LOA, invoice, and account/address details — e.g. an ID copy, proof of address, a tax id, or a porting code. Call it after the portability check (which returns each number's `countryCode` and `phoneNumberType`), render the fields, and pass the collected values as the create request's `requirements`. US/CA return an empty list.

Parameters:

  • country (String)

    ISO country of the numbers being ported (a supported port-in country).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :number_type (String)

    The portability check's phoneNumberType — requirements differ by type. (default to 'local')

Returns:



577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 577

def get_phone_number_port_in_requirements_with_http_info(country, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.get_phone_number_port_in_requirements ...'
  end
  # verify the required parameter 'country' is set
  if @api_client.config.client_side_validation && country.nil?
    fail ArgumentError, "Missing the required parameter 'country' when calling PhoneNumbersApi.get_phone_number_port_in_requirements"
  end
  if @api_client.config.client_side_validation && country.to_s.length > 2
    fail ArgumentError, 'invalid value for "country" when calling PhoneNumbersApi.get_phone_number_port_in_requirements, the character length must be smaller than or equal to 2.'
  end

  if @api_client.config.client_side_validation && country.to_s.length < 2
    fail ArgumentError, 'invalid value for "country" when calling PhoneNumbersApi.get_phone_number_port_in_requirements, the character length must be greater than or equal to 2.'
  end

  allowable_values = ["local", "mobile", "national", "toll_free"]
  if @api_client.config.client_side_validation && opts[:'number_type'] && !allowable_values.include?(opts[:'number_type'])
    fail ArgumentError, "invalid value for \"number_type\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/port-in/requirements'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'country'] = country
  query_params[:'numberType'] = opts[:'number_type'] if !opts[:'number_type'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetPhoneNumberPortInRequirements200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.get_phone_number_port_in_requirements",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#get_phone_number_port_in_requirements\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_phone_number_remediation(id, opts = {}) ⇒ GetPhoneNumberRemediation200Response

Get declined requirements For a number in regulatory_declined, returns ONLY the requirements the reviewer flagged declined, as a form spec (same shape as the KYC form GET). The customer fixes just those — Telnyx supports correcting a declined requirement group and re-submitting it (no new number/group). Falls back to the full spec if the provider exposes no per-requirement flags.

Parameters:

  • id (String)

    Phone number record ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



644
645
646
647
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 644

def get_phone_number_remediation(id, opts = {})
  data, _status_code, _headers = get_phone_number_remediation_with_http_info(id, opts)
  data
end

#get_phone_number_remediation_with_http_info(id, opts = {}) ⇒ Array<(GetPhoneNumberRemediation200Response, Integer, Hash)>

Get declined requirements For a number in `regulatory_declined`, returns ONLY the requirements the reviewer flagged declined, as a form spec (same shape as the KYC form GET). The customer fixes just those — Telnyx supports correcting a declined requirement group and re-submitting it (no new number/group). Falls back to the full spec if the provider exposes no per-requirement flags.

Parameters:

  • id (String)

    Phone number record ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 654

def get_phone_number_remediation_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.get_phone_number_remediation ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling PhoneNumbersApi.get_phone_number_remediation"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/{id}/remediate'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetPhoneNumberRemediation200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.get_phone_number_remediation",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#get_phone_number_remediation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_phone_number_with_http_info(id, opts = {}) ⇒ Array<(GetPhoneNumber200Response, Integer, Hash)>

Get phone number Retrieve the current status of a purchased phone number. Poll this to track Meta pre-verification (US sync path) and, for regulated (Tier 3/4) numbers, the async lifecycle: pending_regulatory → active (or regulatory_declined). When a regulated number has an Onfido ID step, `onfidoVerificationUrl` appears here once the order is placed — forward it to the end user. (Or subscribe to the whatsapp.number.* webhooks instead of polling.)

Parameters:

  • id (String)

    Phone number record ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetPhoneNumber200Response, Integer, Hash)>)

    GetPhoneNumber200Response data, response status code and response headers



378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 378

def get_phone_number_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.get_phone_number ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling PhoneNumbersApi.get_phone_number"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetPhoneNumber200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.get_phone_number",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#get_phone_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_phone_number_countries(opts = {}) ⇒ ListPhoneNumberCountries200Response

List offerable number countries The phone number countries available to purchase, each with its flat monthly price (cents), regulatory tier, whether it needs end-user KYC (Tier 3/4), and per-feature availability (PSTN calls, WhatsApp, SMS, and WhatsApp Business Calling outbound). Drives the country picker. Tier-4 countries appear only when enabled.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



706
707
708
709
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 706

def list_phone_number_countries(opts = {})
  data, _status_code, _headers = list_phone_number_countries_with_http_info(opts)
  data
end

#list_phone_number_countries_with_http_info(opts = {}) ⇒ Array<(ListPhoneNumberCountries200Response, Integer, Hash)>

List offerable number countries The phone number countries available to purchase, each with its flat monthly price (cents), regulatory tier, whether it needs end-user KYC (Tier 3/4), and per-feature availability (PSTN calls, WhatsApp, SMS, and WhatsApp Business Calling outbound). Drives the country picker. Tier-4 countries appear only when enabled.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 715

def list_phone_number_countries_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.list_phone_number_countries ...'
  end
  # resource path
  local_var_path = '/v1/phone-numbers/countries'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListPhoneNumberCountries200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.list_phone_number_countries",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#list_phone_number_countries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_phone_number_port_ins(opts = {}) ⇒ ListPhoneNumberPortIns200Response

List port-in orders Your porting orders, newest first (max 50). Poll this for port progress: pending, confirmed FOC date, exception reason, or ported.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



763
764
765
766
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 763

def list_phone_number_port_ins(opts = {})
  data, _status_code, _headers = list_phone_number_port_ins_with_http_info(opts)
  data
end

#list_phone_number_port_ins_with_http_info(opts = {}) ⇒ Array<(ListPhoneNumberPortIns200Response, Integer, Hash)>

List port-in orders Your porting orders, newest first (max 50). Poll this for port progress: pending, confirmed FOC date, exception reason, or ported.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 772

def list_phone_number_port_ins_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.list_phone_number_port_ins ...'
  end
  # resource path
  local_var_path = '/v1/phone-numbers/port-in'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListPhoneNumberPortIns200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.list_phone_number_port_ins",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#list_phone_number_port_ins\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_phone_numbers(opts = {}) ⇒ ListPhoneNumbers200Response

List phone numbers List all phone numbers purchased by the authenticated user. By default, released numbers are excluded. Connected (bring-your-own) WhatsApp numbers are returned in the separate connected array; they are not billed and have no provisioning lifecycle.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :status (String)

    Filter by status (by default excludes released numbers). NOTE: `status=pending_regulatory` returns the &quot;provisioning&quot; view — numbers still in review PLUS recently-declined (last 30 days) ones, so a failed registration surfaces (with `regulatoryDeclineReason`) instead of silently disappearing. Declined numbers can be re-submitted via POST /v1/phone-numbers/id/remediate. `verifying` is the short-lived state after the number is provisioned on our side while WhatsApp confirms the activation code; the number is not billed until it reaches `active`.

  • :profile_id (String)

    Filter by profile

Returns:



822
823
824
825
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 822

def list_phone_numbers(opts = {})
  data, _status_code, _headers = list_phone_numbers_with_http_info(opts)
  data
end

#list_phone_numbers_with_http_info(opts = {}) ⇒ Array<(ListPhoneNumbers200Response, Integer, Hash)>

List phone numbers List all phone numbers purchased by the authenticated user. By default, released numbers are excluded. Connected (bring-your-own) WhatsApp numbers are returned in the separate `connected` array; they are not billed and have no provisioning lifecycle.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :status (String)

    Filter by status (by default excludes released numbers). NOTE: `status=pending_regulatory` returns the &quot;provisioning&quot; view — numbers still in review PLUS recently-declined (last 30 days) ones, so a failed registration surfaces (with `regulatoryDeclineReason`) instead of silently disappearing. Declined numbers can be re-submitted via POST /v1/phone-numbers/id/remediate. `verifying` is the short-lived state after the number is provisioned on our side while WhatsApp confirms the activation code; the number is not billed until it reaches `active`.

  • :profile_id (String)

    Filter by profile

Returns:

  • (Array<(ListPhoneNumbers200Response, Integer, Hash)>)

    ListPhoneNumbers200Response data, response status code and response headers



833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 833

def list_phone_numbers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.list_phone_numbers ...'
  end
  allowable_values = ["provisioning", "verifying", "pending_payment", "pending_regulatory", "regulatory_declined", "active", "suspended", "releasing", "released"]
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/phone-numbers'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'profileId'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListPhoneNumbers200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.list_phone_numbers",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#list_phone_numbers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#purchase_phone_number(purchase_phone_number_request, opts = {}) ⇒ PurchasePhoneNumber200Response

Purchase phone number Payment-first: you do not pick a specific number, the system provisions one and auto-assigns it. With usage-based billing active and a payment method on file, the number provisions inline and bills per month on your usage-based invoice (there is no checkout redirect). No payment method on file returns 402 PAYMENT_REQUIRED; a regulated country returns 202 with status: \"kyc_required\" and a kycUrl. Requires usage-based billing (the Usage plan). The maximum number of phone numbers is determined by the user's plan.

Parameters:

Returns:



888
889
890
891
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 888

def purchase_phone_number(purchase_phone_number_request, opts = {})
  data, _status_code, _headers = purchase_phone_number_with_http_info(purchase_phone_number_request, opts)
  data
end

#purchase_phone_number_with_http_info(purchase_phone_number_request, opts = {}) ⇒ Array<(PurchasePhoneNumber200Response, Integer, Hash)>

Purchase phone number Payment-first: you do not pick a specific number, the system provisions one and auto-assigns it. With usage-based billing active and a payment method on file, the number provisions inline and bills per month on your usage-based invoice (there is no checkout redirect). No payment method on file returns `402 PAYMENT_REQUIRED`; a regulated country returns `202` with `status: &quot;kyc_required&quot;` and a `kycUrl`. Requires usage-based billing (the Usage plan). The maximum number of phone numbers is determined by the user's plan.

Parameters:

Returns:



898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 898

def purchase_phone_number_with_http_info(purchase_phone_number_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.purchase_phone_number ...'
  end
  # verify the required parameter 'purchase_phone_number_request' is set
  if @api_client.config.client_side_validation && purchase_phone_number_request.nil?
    fail ArgumentError, "Missing the required parameter 'purchase_phone_number_request' when calling PhoneNumbersApi.purchase_phone_number"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/purchase'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(purchase_phone_number_request)

  # return_type
  return_type = opts[:debug_return_type] || 'PurchasePhoneNumber200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.purchase_phone_number",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#purchase_phone_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#release_phone_number(id, opts = {}) ⇒ ReleasePhoneNumber200Response

Release phone number Release a purchased phone number. This will: 1. Disconnect any linked WhatsApp social account 2. Decrement the Stripe subscription quantity (or cancel if last number) 3. Release the number from Telnyx 4. Mark the number as released

Parameters:

  • id (String)

    Phone number record ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



956
957
958
959
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 956

def release_phone_number(id, opts = {})
  data, _status_code, _headers = release_phone_number_with_http_info(id, opts)
  data
end

#release_phone_number_with_http_info(id, opts = {}) ⇒ Array<(ReleasePhoneNumber200Response, Integer, Hash)>

Release phone number Release a purchased phone number. This will: 1. Disconnect any linked WhatsApp social account 2. Decrement the Stripe subscription quantity (or cancel if last number) 3. Release the number from Telnyx 4. Mark the number as released

Parameters:

  • id (String)

    Phone number record ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 966

def release_phone_number_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.release_phone_number ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling PhoneNumbersApi.release_phone_number"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ReleasePhoneNumber200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.release_phone_number",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#release_phone_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remediate_phone_number(id, remediate_phone_number_request, opts = {}) ⇒ RemediatePhoneNumber200Response

Resubmit a declined number Submit corrected values/documents for the declined requirement(s). We PATCH them onto the SAME requirement group and re-submit it for approval; the number goes regulatory_declinedpending_regulatory. No new number and no new billing. Body shape matches the KYC submit (values / documents / address) — send only the corrected fields.

Parameters:

Returns:



1020
1021
1022
1023
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1020

def remediate_phone_number(id, remediate_phone_number_request, opts = {})
  data, _status_code, _headers = remediate_phone_number_with_http_info(id, remediate_phone_number_request, opts)
  data
end

#remediate_phone_number_with_http_info(id, remediate_phone_number_request, opts = {}) ⇒ Array<(RemediatePhoneNumber200Response, Integer, Hash)>

Resubmit a declined number Submit corrected values/documents for the declined requirement(s). We PATCH them onto the SAME requirement group and re-submit it for approval; the number goes `regulatory_declined` → `pending_regulatory`. No new number and no new billing. Body shape matches the KYC submit (values / documents / address) — send only the corrected fields.

Parameters:

Returns:



1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1031

def remediate_phone_number_with_http_info(id, remediate_phone_number_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.remediate_phone_number ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling PhoneNumbersApi.remediate_phone_number"
  end
  # verify the required parameter 'remediate_phone_number_request' is set
  if @api_client.config.client_side_validation && remediate_phone_number_request.nil?
    fail ArgumentError, "Missing the required parameter 'remediate_phone_number_request' when calling PhoneNumbersApi.remediate_phone_number"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/{id}/remediate'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(remediate_phone_number_request)

  # return_type
  return_type = opts[:debug_return_type] || 'RemediatePhoneNumber200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.remediate_phone_number",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#remediate_phone_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#reply_to_phone_number_reviewer(id, reply_to_phone_number_reviewer_request, opts = {}) ⇒ ReplyToPhoneNumberReviewer200Response

Reply to the regulatory reviewer Post a free-text reply (with optional file attachments) to the reviewer on a number awaiting remediation — for asks the structured form can't express (e.g. "is this personal or business?"). Attachments are stored by us and their links are added to the reviewer's comment thread (the carrier's number order takes no loose files). A reply to a comment-style ask moves the number back to "in review"; a reply on a formal decline is supplementary and you must still resubmit the fix. Requires text or at least one attachment.

Parameters:

Returns:



1094
1095
1096
1097
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1094

def reply_to_phone_number_reviewer(id, reply_to_phone_number_reviewer_request, opts = {})
  data, _status_code, _headers = reply_to_phone_number_reviewer_with_http_info(id, reply_to_phone_number_reviewer_request, opts)
  data
end

#reply_to_phone_number_reviewer_with_http_info(id, reply_to_phone_number_reviewer_request, opts = {}) ⇒ Array<(ReplyToPhoneNumberReviewer200Response, Integer, Hash)>

Reply to the regulatory reviewer Post a free-text reply (with optional file attachments) to the reviewer on a number awaiting remediation — for asks the structured form can't express (e.g. &quot;is this personal or business?&quot;). Attachments are stored by us and their links are added to the reviewer's comment thread (the carrier's number order takes no loose files). A reply to a comment-style ask moves the number back to &quot;in review&quot;; a reply on a formal decline is supplementary and you must still resubmit the fix. Requires text or at least one attachment.

Parameters:

Returns:



1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1105

def reply_to_phone_number_reviewer_with_http_info(id, reply_to_phone_number_reviewer_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.reply_to_phone_number_reviewer ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling PhoneNumbersApi.reply_to_phone_number_reviewer"
  end
  # verify the required parameter 'reply_to_phone_number_reviewer_request' is set
  if @api_client.config.client_side_validation && reply_to_phone_number_reviewer_request.nil?
    fail ArgumentError, "Missing the required parameter 'reply_to_phone_number_reviewer_request' when calling PhoneNumbersApi.reply_to_phone_number_reviewer"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/{id}/remediate/reply'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(reply_to_phone_number_reviewer_request)

  # return_type
  return_type = opts[:debug_return_type] || 'ReplyToPhoneNumberReviewer200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.reply_to_phone_number_reviewer",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#reply_to_phone_number_reviewer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#respond_to_phone_number_reviewer(id, respond_to_phone_number_reviewer_request, opts = {}) ⇒ RespondToPhoneNumberReviewer200Response

Respond to the regulatory reviewer (message + corrections) Send a single response to the reviewer on a number awaiting remediation: a free-text message and/or corrected requirement documents, in one call. If corrections are present they are PATCHed onto the requirement group and re-submitted (the number goes back to "in review"); if a message or file attachments are present they are posted to the reviewer's comment thread. When both are present, your message is the thread comment and the resubmit drives the state change. At least one of message, corrections, or attachments is required. documents correct requirement slots; attachments are loose files (their links are added to your message).

Parameters:

Returns:



1168
1169
1170
1171
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1168

def respond_to_phone_number_reviewer(id, respond_to_phone_number_reviewer_request, opts = {})
  data, _status_code, _headers = respond_to_phone_number_reviewer_with_http_info(id, respond_to_phone_number_reviewer_request, opts)
  data
end

#respond_to_phone_number_reviewer_with_http_info(id, respond_to_phone_number_reviewer_request, opts = {}) ⇒ Array<(RespondToPhoneNumberReviewer200Response, Integer, Hash)>

Respond to the regulatory reviewer (message + corrections) Send a single response to the reviewer on a number awaiting remediation: a free-text message and/or corrected requirement documents, in one call. If corrections are present they are PATCHed onto the requirement group and re-submitted (the number goes back to &quot;in review&quot;); if a message or file attachments are present they are posted to the reviewer's comment thread. When both are present, your message is the thread comment and the resubmit drives the state change. At least one of message, corrections, or attachments is required. `documents` correct requirement slots; `attachments` are loose files (their links are added to your message).

Parameters:

Returns:



1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1179

def respond_to_phone_number_reviewer_with_http_info(id, respond_to_phone_number_reviewer_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.respond_to_phone_number_reviewer ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling PhoneNumbersApi.respond_to_phone_number_reviewer"
  end
  # verify the required parameter 'respond_to_phone_number_reviewer_request' is set
  if @api_client.config.client_side_validation && respond_to_phone_number_reviewer_request.nil?
    fail ArgumentError, "Missing the required parameter 'respond_to_phone_number_reviewer_request' when calling PhoneNumbersApi.respond_to_phone_number_reviewer"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/{id}/remediate/respond'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(respond_to_phone_number_reviewer_request)

  # return_type
  return_type = opts[:debug_return_type] || 'RespondToPhoneNumberReviewer200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.respond_to_phone_number_reviewer",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#respond_to_phone_number_reviewer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#review_phone_number_kyc_packet(review_phone_number_kyc_packet_request, opts = {}) ⇒ ReviewPhoneNumberKycPacket200Response

Pre-review a KYC packet Advisory dry-run of a regulated-KYC packet before submitting: reviews the exact documents the regulator will see (referenced by the ids from POST /v1/phone-numbers/kyc/upload-document) against the declared values and address, and returns plain-language advisories for likely decline reasons (wrong document type, mismatched address, one-sided ID scans). Non-blocking: advisories are warnings, submitting anyway is always allowed, and any review failure degrades to an empty list.

Parameters:

Returns:



1241
1242
1243
1244
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1241

def review_phone_number_kyc_packet(review_phone_number_kyc_packet_request, opts = {})
  data, _status_code, _headers = review_phone_number_kyc_packet_with_http_info(review_phone_number_kyc_packet_request, opts)
  data
end

#review_phone_number_kyc_packet_with_http_info(review_phone_number_kyc_packet_request, opts = {}) ⇒ Array<(ReviewPhoneNumberKycPacket200Response, Integer, Hash)>

Pre-review a KYC packet Advisory dry-run of a regulated-KYC packet before submitting: reviews the exact documents the regulator will see (referenced by the ids from POST /v1/phone-numbers/kyc/upload-document) against the declared values and address, and returns plain-language advisories for likely decline reasons (wrong document type, mismatched address, one-sided ID scans). Non-blocking: advisories are warnings, submitting anyway is always allowed, and any review failure degrades to an empty list.

Parameters:

Returns:



1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1251

def review_phone_number_kyc_packet_with_http_info(review_phone_number_kyc_packet_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.review_phone_number_kyc_packet ...'
  end
  # verify the required parameter 'review_phone_number_kyc_packet_request' is set
  if @api_client.config.client_side_validation && review_phone_number_kyc_packet_request.nil?
    fail ArgumentError, "Missing the required parameter 'review_phone_number_kyc_packet_request' when calling PhoneNumbersApi.review_phone_number_kyc_packet"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/kyc/review-packet'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(review_phone_number_kyc_packet_request)

  # return_type
  return_type = opts[:debug_return_type] || 'ReviewPhoneNumberKycPacket200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.review_phone_number_kyc_packet",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#review_phone_number_kyc_packet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#search_available_phone_numbers(opts = {}) ⇒ SearchAvailablePhoneNumbers200Response

Search available numbers Search the provider's inventory for numbers available to purchase in a country (default US). Optional filters narrow the results. The country must be offerable (see GET /v1/phone-numbers/countries). Voice capability is always required; pass sms=true to only see numbers that can also text (SMS support is per-number, not per-country).

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :country (String) — default: default to 'US'
  • :type (String)

    Number type; defaults to the country's WhatsApp-safe type

  • :prefix (String)

    Area code

  • :locality (String)

    City

  • :contains (String)

    Pattern to match within the number

  • :sms (Boolean)

    true narrows the pool to SMS-capable numbers. Each result still carries its full `features` list for per-number capability badging.

  • :limit (Integer) — default: default to 20

Returns:



1315
1316
1317
1318
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1315

def search_available_phone_numbers(opts = {})
  data, _status_code, _headers = search_available_phone_numbers_with_http_info(opts)
  data
end

#search_available_phone_numbers_with_http_info(opts = {}) ⇒ Array<(SearchAvailablePhoneNumbers200Response, Integer, Hash)>

Search available numbers Search the provider's inventory for numbers available to purchase in a country (default US). Optional filters narrow the results. The country must be offerable (see GET /v1/phone-numbers/countries). Voice capability is always required; pass `sms=true` to only see numbers that can also text (SMS support is per-number, not per-country).

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :country (String) — default: default to 'US'
  • :type (String)

    Number type; defaults to the country's WhatsApp-safe type

  • :prefix (String)

    Area code

  • :locality (String)

    City

  • :contains (String)

    Pattern to match within the number

  • :sms (Boolean)

    true narrows the pool to SMS-capable numbers. Each result still carries its full `features` list for per-number capability badging.

  • :limit (Integer) — default: default to 20

Returns:



1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1331

def search_available_phone_numbers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.search_available_phone_numbers ...'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PhoneNumbersApi.search_available_phone_numbers, must be smaller than or equal to 100.'
  end

  # resource path
  local_var_path = '/v1/phone-numbers/available'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'country'] = opts[:'country'] if !opts[:'country'].nil?
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
  query_params[:'prefix'] = opts[:'prefix'] if !opts[:'prefix'].nil?
  query_params[:'locality'] = opts[:'locality'] if !opts[:'locality'].nil?
  query_params[:'contains'] = opts[:'contains'] if !opts[:'contains'].nil?
  query_params[:'sms'] = opts[:'sms'] if !opts[:'sms'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SearchAvailablePhoneNumbers200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.search_available_phone_numbers",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#search_available_phone_numbers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#submit_phone_number_kyc(submit_phone_number_kyc_request, opts = {}) ⇒ SubmitPhoneNumberKyc200Response

Submit KYC Submit the end customer's KYC (textual values, uploaded documents, address) for a Tier 3/4 country. Documents are streamed straight to the number provider and are not stored by Zernio. Builds + submits a regulatory requirement group and claims a pending_regulatory slot; the number is ordered + activated once the provider approves (asynchronous). A customer may hold several same-country numbers in review at once; a double-submit of the SAME attempt is deduped via submissionId. For an ID-card document requirement, carriers commonly require BOTH sides: combine the front and back into a single file before uploading (the dashboard does this automatically). A one-sided ID is a common decline reason; fix it via POST /v1/phone-numbers/id/remediate. Before submitting, call GET /v1/phone-numbers/availability to check the country has deliverable inventory and, for geographic-match countries, which area the address must be in — otherwise the submission can pass review yet never be assignable a number.

Parameters:

Returns:



1391
1392
1393
1394
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1391

def submit_phone_number_kyc(submit_phone_number_kyc_request, opts = {})
  data, _status_code, _headers = submit_phone_number_kyc_with_http_info(submit_phone_number_kyc_request, opts)
  data
end

#submit_phone_number_kyc_with_http_info(submit_phone_number_kyc_request, opts = {}) ⇒ Array<(SubmitPhoneNumberKyc200Response, Integer, Hash)>

Submit KYC Submit the end customer's KYC (textual values, uploaded documents, address) for a Tier 3/4 country. Documents are streamed straight to the number provider and are not stored by Zernio. Builds + submits a regulatory requirement group and claims a pending_regulatory slot; the number is ordered + activated once the provider approves (asynchronous). A customer may hold several same-country numbers in review at once; a double-submit of the SAME attempt is deduped via `submissionId`. For an ID-card document requirement, carriers commonly require BOTH sides: combine the front and back into a single file before uploading (the dashboard does this automatically). A one-sided ID is a common decline reason; fix it via POST /v1/phone-numbers/id/remediate. Before submitting, call GET /v1/phone-numbers/availability to check the country has deliverable inventory and, for geographic-match countries, which area the address must be in — otherwise the submission can pass review yet never be assignable a number.

Parameters:

Returns:



1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1401

def submit_phone_number_kyc_with_http_info(submit_phone_number_kyc_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.submit_phone_number_kyc ...'
  end
  # verify the required parameter 'submit_phone_number_kyc_request' is set
  if @api_client.config.client_side_validation && submit_phone_number_kyc_request.nil?
    fail ArgumentError, "Missing the required parameter 'submit_phone_number_kyc_request' when calling PhoneNumbersApi.submit_phone_number_kyc"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/kyc'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(submit_phone_number_kyc_request)

  # return_type
  return_type = opts[:debug_return_type] || 'SubmitPhoneNumberKyc200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.submit_phone_number_kyc",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#submit_phone_number_kyc\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#upload_phone_number_kyc_document(x_filename, body, opts = {}) ⇒ UploadPhoneNumberKycDocument200Response

Upload a KYC document Upload ONE document and get back its provider document id, to reference from POST /v1/phone-numbers/kyc via documents[].documentId. Send the RAW file bytes as the request body (not base64); put the filename in the X-Filename header. Uploading documents one-per-request keeps each request under the ~4.5MB body limit. The document streams straight to the number provider and is not stored by Zernio.

Parameters:

  • x_filename (String)

    URL-encoded original filename.

  • body (File)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1460
1461
1462
1463
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1460

def upload_phone_number_kyc_document(x_filename, body, opts = {})
  data, _status_code, _headers = upload_phone_number_kyc_document_with_http_info(x_filename, body, opts)
  data
end

#upload_phone_number_kyc_document_with_http_info(x_filename, body, opts = {}) ⇒ Array<(UploadPhoneNumberKycDocument200Response, Integer, Hash)>

Upload a KYC document Upload ONE document and get back its provider document id, to reference from POST /v1/phone-numbers/kyc via `documents.documentId`. Send the RAW file bytes as the request body (not base64); put the filename in the `X-Filename` header. Uploading documents one-per-request keeps each request under the ~4.5MB body limit. The document streams straight to the number provider and is not stored by Zernio.

Parameters:

  • x_filename (String)

    URL-encoded original filename.

  • body (File)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1471

def upload_phone_number_kyc_document_with_http_info(x_filename, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.upload_phone_number_kyc_document ...'
  end
  # verify the required parameter 'x_filename' is set
  if @api_client.config.client_side_validation && x_filename.nil?
    fail ArgumentError, "Missing the required parameter 'x_filename' when calling PhoneNumbersApi.upload_phone_number_kyc_document"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling PhoneNumbersApi.upload_phone_number_kyc_document"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/kyc/upload-document'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/octet-stream'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'X-Filename'] = x_filename

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'UploadPhoneNumberKycDocument200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.upload_phone_number_kyc_document",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#upload_phone_number_kyc_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#upload_phone_number_port_in_document(file, opts = {}) ⇒ UploadPhoneNumberPortInDocument200Response

Upload a porting document Upload ONE porting document and get back its documentId. For the signed LOA / carrier invoice the id goes to loaDocumentId / invoiceDocumentId; for a country-specific document requirement (international ports) it becomes that requirement's fieldValue. Requirement documents are normalized to PDF automatically (regulators reject raw images). PDF, JPEG, or PNG, 10MB max. Uploads must be attached to an order within 30 minutes or the carrier deletes them.

Parameters:

  • file (File)

    The document (PDF/JPEG/PNG, 10MB max).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :kind (String)

    'loa', 'invoice', or any short slug for requirement documents. Informational; used for the stored filename.

Returns:



1535
1536
1537
1538
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1535

def upload_phone_number_port_in_document(file, opts = {})
  data, _status_code, _headers = upload_phone_number_port_in_document_with_http_info(file, opts)
  data
end

#upload_phone_number_port_in_document_with_http_info(file, opts = {}) ⇒ Array<(UploadPhoneNumberPortInDocument200Response, Integer, Hash)>

Upload a porting document Upload ONE porting document and get back its `documentId`. For the signed LOA / carrier invoice the id goes to `loaDocumentId` / `invoiceDocumentId`; for a country-specific document requirement (international ports) it becomes that requirement's `fieldValue`. Requirement documents are normalized to PDF automatically (regulators reject raw images). PDF, JPEG, or PNG, 10MB max. Uploads must be attached to an order within 30 minutes or the carrier deletes them.

Parameters:

  • file (File)

    The document (PDF/JPEG/PNG, 10MB max).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :kind (String)

    'loa', 'invoice', or any short slug for requirement documents. Informational; used for the stored filename.

Returns:



1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1546

def upload_phone_number_port_in_document_with_http_info(file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.upload_phone_number_port_in_document ...'
  end
  # verify the required parameter 'file' is set
  if @api_client.config.client_side_validation && file.nil?
    fail ArgumentError, "Missing the required parameter 'file' when calling PhoneNumbersApi.upload_phone_number_port_in_document"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/port-in/documents'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['multipart/form-data'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['file'] = file
  form_params['kind'] = opts[:'kind'] if !opts[:'kind'].nil?

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UploadPhoneNumberPortInDocument200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.upload_phone_number_port_in_document",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#upload_phone_number_port_in_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#validate_phone_number_kyc_address(validate_phone_number_kyc_address_request, opts = {}) ⇒ ValidatePhoneNumberKycAddress200Response

Pre-validate KYC address Optional early check for the address step of a Tier 4 (end-user identity) registration: validates a postal address for deliverability BEFORE the full KYC submit, so it can be corrected before any documents are uploaded. The full submit (POST /v1/phone-numbers/kyc) re-validates the address, so this call is purely a fast feedback path and skipping it is safe. Only the postal address is sent (no documents, no gov-ID fields). A region (administrative_area) is required by the validator; when it is omitted the pre-check is skipped and { ok: true, skipped: true } is returned (the final submit still validates).

Parameters:

Returns:



1606
1607
1608
1609
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1606

def validate_phone_number_kyc_address(validate_phone_number_kyc_address_request, opts = {})
  data, _status_code, _headers = validate_phone_number_kyc_address_with_http_info(validate_phone_number_kyc_address_request, opts)
  data
end

#validate_phone_number_kyc_address_with_http_info(validate_phone_number_kyc_address_request, opts = {}) ⇒ Array<(ValidatePhoneNumberKycAddress200Response, Integer, Hash)>

Pre-validate KYC address Optional early check for the address step of a Tier 4 (end-user identity) registration: validates a postal address for deliverability BEFORE the full KYC submit, so it can be corrected before any documents are uploaded. The full submit (POST /v1/phone-numbers/kyc) re-validates the address, so this call is purely a fast feedback path and skipping it is safe. Only the postal address is sent (no documents, no gov-ID fields). A region (`administrative_area`) is required by the validator; when it is omitted the pre-check is skipped and `{ ok: true, skipped: true }` is returned (the final submit still validates).

Parameters:

Returns:



1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1616

def validate_phone_number_kyc_address_with_http_info(validate_phone_number_kyc_address_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.validate_phone_number_kyc_address ...'
  end
  # verify the required parameter 'validate_phone_number_kyc_address_request' is set
  if @api_client.config.client_side_validation && validate_phone_number_kyc_address_request.nil?
    fail ArgumentError, "Missing the required parameter 'validate_phone_number_kyc_address_request' when calling PhoneNumbersApi.validate_phone_number_kyc_address"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/kyc/validate-address'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(validate_phone_number_kyc_address_request)

  # return_type
  return_type = opts[:debug_return_type] || 'ValidatePhoneNumberKycAddress200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.validate_phone_number_kyc_address",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#validate_phone_number_kyc_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#view_phone_number_kyc_document(document_id, opts = {}) ⇒ File

View a KYC document on file Stream a document backing a reusable verification (the documentId values from GET /v1/phone-numbers/kyc reusable.options[].details[]), so the account holder can see what's on file before reusing it. Returned inline as application/pdf (uploads are normalized to PDF). Auth-scoped: a document is viewable only when its id is referenced by one of the caller's own numbers — otherwise 404.

Parameters:

  • document_id (String)

    The Telnyx document id (from `reusable.options.details.documentId`).

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (File)


1674
1675
1676
1677
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1674

def view_phone_number_kyc_document(document_id, opts = {})
  data, _status_code, _headers = view_phone_number_kyc_document_with_http_info(document_id, opts)
  data
end

#view_phone_number_kyc_document_with_http_info(document_id, opts = {}) ⇒ Array<(File, Integer, Hash)>

View a KYC document on file Stream a document backing a reusable verification (the `documentId` values from GET /v1/phone-numbers/kyc `reusable.options.details`), so the account holder can see what's on file before reusing it. Returned inline as `application/pdf` (uploads are normalized to PDF). Auth-scoped: a document is viewable only when its id is referenced by one of the caller's own numbers — otherwise `404`.

Parameters:

  • document_id (String)

    The Telnyx document id (from `reusable.options.details.documentId`).

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(File, Integer, Hash)>)

    File data, response status code and response headers



1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1684

def view_phone_number_kyc_document_with_http_info(document_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.view_phone_number_kyc_document ...'
  end
  # verify the required parameter 'document_id' is set
  if @api_client.config.client_side_validation && document_id.nil?
    fail ArgumentError, "Missing the required parameter 'document_id' when calling PhoneNumbersApi.view_phone_number_kyc_document"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/kyc/document/{documentId}'.sub('{' + 'documentId' + '}', CGI.escape(document_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'File'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.view_phone_number_kyc_document",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#view_phone_number_kyc_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end