late-sdk 0.0.726 → 0.0.727

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +19 -0
  3. data/docs/AttachNumberToSipTrunk200Response.md +22 -0
  4. data/docs/AttachNumberToSipTrunkRequest.md +18 -0
  5. data/docs/CreateSipTrunk201Response.md +34 -0
  6. data/docs/CreateSipTrunk201ResponseTermination.md +20 -0
  7. data/docs/CreateSipTrunkRequest.md +24 -0
  8. data/docs/DetachNumberFromSipTrunk200Response.md +20 -0
  9. data/docs/GetPhoneNumber200ResponsePhoneNumber.md +3 -1
  10. data/docs/GetSipTrunk200Response.md +34 -0
  11. data/docs/GetSipTrunk200ResponseNumbersInner.md +20 -0
  12. data/docs/ListPhoneNumbers200ResponseNumbersInner.md +2 -0
  13. data/docs/ListSipTrunks200Response.md +20 -0
  14. data/docs/ListSipTrunks200ResponseTrunksInner.md +32 -0
  15. data/docs/ListSipTrunks200ResponseTrunksInnerTermination.md +20 -0
  16. data/docs/RotateSipTrunkCredentials200Response.md +20 -0
  17. data/docs/VoiceApi.md +485 -0
  18. data/lib/zernio-sdk/api/voice_api.rb +447 -0
  19. data/lib/zernio-sdk/models/attach_number_to_sip_trunk200_response.rb +165 -0
  20. data/lib/zernio-sdk/models/attach_number_to_sip_trunk_request.rb +165 -0
  21. data/lib/zernio-sdk/models/create_sip_trunk201_response.rb +255 -0
  22. data/lib/zernio-sdk/models/create_sip_trunk201_response_termination.rb +158 -0
  23. data/lib/zernio-sdk/models/create_sip_trunk_request.rb +283 -0
  24. data/lib/zernio-sdk/models/detach_number_from_sip_trunk200_response.rb +157 -0
  25. data/lib/zernio-sdk/models/get_phone_number200_response_phone_number.rb +15 -4
  26. data/lib/zernio-sdk/models/get_sip_trunk200_response.rb +256 -0
  27. data/lib/zernio-sdk/models/get_sip_trunk200_response_numbers_inner.rb +157 -0
  28. data/lib/zernio-sdk/models/list_phone_numbers200_response_numbers_inner.rb +12 -1
  29. data/lib/zernio-sdk/models/list_sip_trunks200_response.rb +159 -0
  30. data/lib/zernio-sdk/models/list_sip_trunks200_response_trunks_inner.rb +245 -0
  31. data/lib/zernio-sdk/models/list_sip_trunks200_response_trunks_inner_termination.rb +156 -0
  32. data/lib/zernio-sdk/models/rotate_sip_trunk_credentials200_response.rb +156 -0
  33. data/lib/zernio-sdk/version.rb +1 -1
  34. data/lib/zernio-sdk.rb +12 -0
  35. data/openapi.yaml +268 -0
  36. data/spec/api/voice_api_spec.rb +82 -0
  37. data/spec/models/attach_number_to_sip_trunk200_response_spec.rb +48 -0
  38. data/spec/models/attach_number_to_sip_trunk_request_spec.rb +36 -0
  39. data/spec/models/create_sip_trunk201_response_spec.rb +88 -0
  40. data/spec/models/create_sip_trunk201_response_termination_spec.rb +42 -0
  41. data/spec/models/create_sip_trunk_request_spec.rb +58 -0
  42. data/spec/models/detach_number_from_sip_trunk200_response_spec.rb +42 -0
  43. data/spec/models/get_phone_number200_response_phone_number_spec.rb +6 -0
  44. data/spec/models/get_sip_trunk200_response_numbers_inner_spec.rb +42 -0
  45. data/spec/models/get_sip_trunk200_response_spec.rb +88 -0
  46. data/spec/models/list_phone_numbers200_response_numbers_inner_spec.rb +6 -0
  47. data/spec/models/list_sip_trunks200_response_spec.rb +42 -0
  48. data/spec/models/list_sip_trunks200_response_trunks_inner_spec.rb +82 -0
  49. data/spec/models/list_sip_trunks200_response_trunks_inner_termination_spec.rb +42 -0
  50. data/spec/models/rotate_sip_trunk_credentials200_response_spec.rb +42 -0
  51. data/zernio-sdk-0.0.727.gem +0 -0
  52. metadata +51 -3
  53. data/zernio-sdk-0.0.726.gem +0 -0
@@ -19,6 +19,148 @@ module Zernio
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # Attach a number to a SIP trunk
23
+ # Routes the number's calls to the trunk: the external platform receives its inbound directly and can present it as outbound caller ID. While attached, Zernio-side voice features are off for this number (call forwarding, IVR, voicemail, recording, the softphone, and WhatsApp calling), so the number must have Calls and WhatsApp calling disabled before attaching. SMS and WhatsApp messaging are unaffected.
24
+ # @param id [String] Phone number record ID (from GET /v1/phone-numbers).
25
+ # @param attach_number_to_sip_trunk_request [AttachNumberToSipTrunkRequest]
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [AttachNumberToSipTrunk200Response]
28
+ def attach_number_to_sip_trunk(id, attach_number_to_sip_trunk_request, opts = {})
29
+ data, _status_code, _headers = attach_number_to_sip_trunk_with_http_info(id, attach_number_to_sip_trunk_request, opts)
30
+ data
31
+ end
32
+
33
+ # Attach a number to a SIP trunk
34
+ # Routes the number's calls to the trunk: the external platform receives its inbound directly and can present it as outbound caller ID. While attached, Zernio-side voice features are off for this number (call forwarding, IVR, voicemail, recording, the softphone, and WhatsApp calling), so the number must have Calls and WhatsApp calling disabled before attaching. SMS and WhatsApp messaging are unaffected.
35
+ # @param id [String] Phone number record ID (from GET /v1/phone-numbers).
36
+ # @param attach_number_to_sip_trunk_request [AttachNumberToSipTrunkRequest]
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(AttachNumberToSipTrunk200Response, Integer, Hash)>] AttachNumberToSipTrunk200Response data, response status code and response headers
39
+ def attach_number_to_sip_trunk_with_http_info(id, attach_number_to_sip_trunk_request, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: VoiceApi.attach_number_to_sip_trunk ...'
42
+ end
43
+ # verify the required parameter 'id' is set
44
+ if @api_client.config.client_side_validation && id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'id' when calling VoiceApi.attach_number_to_sip_trunk"
46
+ end
47
+ # verify the required parameter 'attach_number_to_sip_trunk_request' is set
48
+ if @api_client.config.client_side_validation && attach_number_to_sip_trunk_request.nil?
49
+ fail ArgumentError, "Missing the required parameter 'attach_number_to_sip_trunk_request' when calling VoiceApi.attach_number_to_sip_trunk"
50
+ end
51
+ # resource path
52
+ local_var_path = '/v1/phone-numbers/{id}/sip-trunk'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
53
+
54
+ # query parameters
55
+ query_params = opts[:query_params] || {}
56
+
57
+ # header parameters
58
+ header_params = opts[:header_params] || {}
59
+ # HTTP header 'Accept' (if needed)
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
61
+ # HTTP header 'Content-Type'
62
+ content_type = @api_client.select_header_content_type(['application/json'])
63
+ if !content_type.nil?
64
+ header_params['Content-Type'] = content_type
65
+ end
66
+
67
+ # form parameters
68
+ form_params = opts[:form_params] || {}
69
+
70
+ # http body (model)
71
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(attach_number_to_sip_trunk_request)
72
+
73
+ # return_type
74
+ return_type = opts[:debug_return_type] || 'AttachNumberToSipTrunk200Response'
75
+
76
+ # auth_names
77
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
78
+
79
+ new_options = opts.merge(
80
+ :operation => :"VoiceApi.attach_number_to_sip_trunk",
81
+ :header_params => header_params,
82
+ :query_params => query_params,
83
+ :form_params => form_params,
84
+ :body => post_body,
85
+ :auth_names => auth_names,
86
+ :return_type => return_type
87
+ )
88
+
89
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
90
+ if @api_client.config.debugging
91
+ @api_client.config.logger.debug "API called: VoiceApi#attach_number_to_sip_trunk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
92
+ end
93
+ return data, status_code, headers
94
+ end
95
+
96
+ # Create a SIP trunk
97
+ # Creates a SIP trunk an external voice platform (Retell, ElevenLabs, Vapi, or any SIP endpoint) can import your Zernio numbers into. The trunk carries both directions: inbound calls on attached numbers are delivered to `sipHost`, and the platform originates outbound calls through `termination.uri` with the digest credentials. The `digestPassword` is returned only by this call (and by rotate-credentials); store it immediately. Attach any number of numbers to a trunk. Several trunks may point at the same host — each carries its own credentials and spend cap, so separate destination workspaces (e.g. an agency's clients) stay isolated.
98
+ # @param create_sip_trunk_request [CreateSipTrunkRequest]
99
+ # @param [Hash] opts the optional parameters
100
+ # @return [CreateSipTrunk201Response]
101
+ def create_sip_trunk(create_sip_trunk_request, opts = {})
102
+ data, _status_code, _headers = create_sip_trunk_with_http_info(create_sip_trunk_request, opts)
103
+ data
104
+ end
105
+
106
+ # Create a SIP trunk
107
+ # Creates a SIP trunk an external voice platform (Retell, ElevenLabs, Vapi, or any SIP endpoint) can import your Zernio numbers into. The trunk carries both directions: inbound calls on attached numbers are delivered to &#x60;sipHost&#x60;, and the platform originates outbound calls through &#x60;termination.uri&#x60; with the digest credentials. The &#x60;digestPassword&#x60; is returned only by this call (and by rotate-credentials); store it immediately. Attach any number of numbers to a trunk. Several trunks may point at the same host — each carries its own credentials and spend cap, so separate destination workspaces (e.g. an agency&#39;s clients) stay isolated.
108
+ # @param create_sip_trunk_request [CreateSipTrunkRequest]
109
+ # @param [Hash] opts the optional parameters
110
+ # @return [Array<(CreateSipTrunk201Response, Integer, Hash)>] CreateSipTrunk201Response data, response status code and response headers
111
+ def create_sip_trunk_with_http_info(create_sip_trunk_request, opts = {})
112
+ if @api_client.config.debugging
113
+ @api_client.config.logger.debug 'Calling API: VoiceApi.create_sip_trunk ...'
114
+ end
115
+ # verify the required parameter 'create_sip_trunk_request' is set
116
+ if @api_client.config.client_side_validation && create_sip_trunk_request.nil?
117
+ fail ArgumentError, "Missing the required parameter 'create_sip_trunk_request' when calling VoiceApi.create_sip_trunk"
118
+ end
119
+ # resource path
120
+ local_var_path = '/v1/phone-numbers/sip-trunks'
121
+
122
+ # query parameters
123
+ query_params = opts[:query_params] || {}
124
+
125
+ # header parameters
126
+ header_params = opts[:header_params] || {}
127
+ # HTTP header 'Accept' (if needed)
128
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
129
+ # HTTP header 'Content-Type'
130
+ content_type = @api_client.select_header_content_type(['application/json'])
131
+ if !content_type.nil?
132
+ header_params['Content-Type'] = content_type
133
+ end
134
+
135
+ # form parameters
136
+ form_params = opts[:form_params] || {}
137
+
138
+ # http body (model)
139
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_sip_trunk_request)
140
+
141
+ # return_type
142
+ return_type = opts[:debug_return_type] || 'CreateSipTrunk201Response'
143
+
144
+ # auth_names
145
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
146
+
147
+ new_options = opts.merge(
148
+ :operation => :"VoiceApi.create_sip_trunk",
149
+ :header_params => header_params,
150
+ :query_params => query_params,
151
+ :form_params => form_params,
152
+ :body => post_body,
153
+ :auth_names => auth_names,
154
+ :return_type => return_type
155
+ )
156
+
157
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
158
+ if @api_client.config.debugging
159
+ @api_client.config.logger.debug "API called: VoiceApi#create_sip_trunk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
160
+ end
161
+ return data, status_code, headers
162
+ end
163
+
22
164
  # Place an outbound phone call
23
165
  # Dials `to` FROM one of your voice-enabled numbers and, on answer, bridges the callee to the number's stored forward destination, or to the per-call `forwardTo` override. Destinations can be your own AI voice agent (Vapi/Retell), a phone, or a SIP endpoint. An optional `greeting` is spoken to the callee before the bridge. The 200 response means the call is dialing; the lifecycle continues asynchronously (track it via `GET /v1/voice/calls/{id}` or the `call.*` webhooks). Outbound calls are capped per rolling hour (429 when hit). **Idempotency:** send an `Idempotency-Key` header to make retries safe; same key + same body replays the original response instead of dialing (and billing) a second call.
24
166
  # @param create_voice_call_request [CreateVoiceCallRequest]
@@ -151,6 +293,132 @@ module Zernio
151
293
  return data, status_code, headers
152
294
  end
153
295
 
296
+ # Delete a SIP trunk
297
+ # Tears down the trunk and its carrier-side objects. Refused while any number is still attached: detach them first.
298
+ # @param id [String]
299
+ # @param [Hash] opts the optional parameters
300
+ # @return [DeleteSmsSenderId200Response]
301
+ def delete_sip_trunk(id, opts = {})
302
+ data, _status_code, _headers = delete_sip_trunk_with_http_info(id, opts)
303
+ data
304
+ end
305
+
306
+ # Delete a SIP trunk
307
+ # Tears down the trunk and its carrier-side objects. Refused while any number is still attached: detach them first.
308
+ # @param id [String]
309
+ # @param [Hash] opts the optional parameters
310
+ # @return [Array<(DeleteSmsSenderId200Response, Integer, Hash)>] DeleteSmsSenderId200Response data, response status code and response headers
311
+ def delete_sip_trunk_with_http_info(id, opts = {})
312
+ if @api_client.config.debugging
313
+ @api_client.config.logger.debug 'Calling API: VoiceApi.delete_sip_trunk ...'
314
+ end
315
+ # verify the required parameter 'id' is set
316
+ if @api_client.config.client_side_validation && id.nil?
317
+ fail ArgumentError, "Missing the required parameter 'id' when calling VoiceApi.delete_sip_trunk"
318
+ end
319
+ # resource path
320
+ local_var_path = '/v1/phone-numbers/sip-trunks/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
321
+
322
+ # query parameters
323
+ query_params = opts[:query_params] || {}
324
+
325
+ # header parameters
326
+ header_params = opts[:header_params] || {}
327
+ # HTTP header 'Accept' (if needed)
328
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
329
+
330
+ # form parameters
331
+ form_params = opts[:form_params] || {}
332
+
333
+ # http body (model)
334
+ post_body = opts[:debug_body]
335
+
336
+ # return_type
337
+ return_type = opts[:debug_return_type] || 'DeleteSmsSenderId200Response'
338
+
339
+ # auth_names
340
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
341
+
342
+ new_options = opts.merge(
343
+ :operation => :"VoiceApi.delete_sip_trunk",
344
+ :header_params => header_params,
345
+ :query_params => query_params,
346
+ :form_params => form_params,
347
+ :body => post_body,
348
+ :auth_names => auth_names,
349
+ :return_type => return_type
350
+ )
351
+
352
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
353
+ if @api_client.config.debugging
354
+ @api_client.config.logger.debug "API called: VoiceApi#delete_sip_trunk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
355
+ end
356
+ return data, status_code, headers
357
+ end
358
+
359
+ # Detach a number from its SIP trunk
360
+ # Returns the number's calls to Zernio routing. Idempotent when the number is not attached to any trunk.
361
+ # @param id [String]
362
+ # @param [Hash] opts the optional parameters
363
+ # @return [DetachNumberFromSipTrunk200Response]
364
+ def detach_number_from_sip_trunk(id, opts = {})
365
+ data, _status_code, _headers = detach_number_from_sip_trunk_with_http_info(id, opts)
366
+ data
367
+ end
368
+
369
+ # Detach a number from its SIP trunk
370
+ # Returns the number&#39;s calls to Zernio routing. Idempotent when the number is not attached to any trunk.
371
+ # @param id [String]
372
+ # @param [Hash] opts the optional parameters
373
+ # @return [Array<(DetachNumberFromSipTrunk200Response, Integer, Hash)>] DetachNumberFromSipTrunk200Response data, response status code and response headers
374
+ def detach_number_from_sip_trunk_with_http_info(id, opts = {})
375
+ if @api_client.config.debugging
376
+ @api_client.config.logger.debug 'Calling API: VoiceApi.detach_number_from_sip_trunk ...'
377
+ end
378
+ # verify the required parameter 'id' is set
379
+ if @api_client.config.client_side_validation && id.nil?
380
+ fail ArgumentError, "Missing the required parameter 'id' when calling VoiceApi.detach_number_from_sip_trunk"
381
+ end
382
+ # resource path
383
+ local_var_path = '/v1/phone-numbers/{id}/sip-trunk'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
384
+
385
+ # query parameters
386
+ query_params = opts[:query_params] || {}
387
+
388
+ # header parameters
389
+ header_params = opts[:header_params] || {}
390
+ # HTTP header 'Accept' (if needed)
391
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
392
+
393
+ # form parameters
394
+ form_params = opts[:form_params] || {}
395
+
396
+ # http body (model)
397
+ post_body = opts[:debug_body]
398
+
399
+ # return_type
400
+ return_type = opts[:debug_return_type] || 'DetachNumberFromSipTrunk200Response'
401
+
402
+ # auth_names
403
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
404
+
405
+ new_options = opts.merge(
406
+ :operation => :"VoiceApi.detach_number_from_sip_trunk",
407
+ :header_params => header_params,
408
+ :query_params => query_params,
409
+ :form_params => form_params,
410
+ :body => post_body,
411
+ :auth_names => auth_names,
412
+ :return_type => return_type
413
+ )
414
+
415
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
416
+ if @api_client.config.debugging
417
+ @api_client.config.logger.debug "API called: VoiceApi#detach_number_from_sip_trunk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
418
+ end
419
+ return data, status_code, headers
420
+ end
421
+
154
422
  # Dial from the browser softphone
155
423
  # Step 2 of the browser softphone handshake: places an outbound call whose answered leg is bridged to the browser registered with the credential from `POST /v1/voice/calls/web`. The call runs through the normal outbound lane, so it is logged as outbound (from = your number, to = target) and recorded per the number's settings.
156
424
  # @param dial_voice_web_call_request [DialVoiceWebCallRequest]
@@ -415,6 +683,67 @@ module Zernio
415
683
  return data, status_code, headers
416
684
  end
417
685
 
686
+ # Get a SIP trunk
687
+ # @param id [String]
688
+ # @param [Hash] opts the optional parameters
689
+ # @return [GetSipTrunk200Response]
690
+ def get_sip_trunk(id, opts = {})
691
+ data, _status_code, _headers = get_sip_trunk_with_http_info(id, opts)
692
+ data
693
+ end
694
+
695
+ # Get a SIP trunk
696
+ # @param id [String]
697
+ # @param [Hash] opts the optional parameters
698
+ # @return [Array<(GetSipTrunk200Response, Integer, Hash)>] GetSipTrunk200Response data, response status code and response headers
699
+ def get_sip_trunk_with_http_info(id, opts = {})
700
+ if @api_client.config.debugging
701
+ @api_client.config.logger.debug 'Calling API: VoiceApi.get_sip_trunk ...'
702
+ end
703
+ # verify the required parameter 'id' is set
704
+ if @api_client.config.client_side_validation && id.nil?
705
+ fail ArgumentError, "Missing the required parameter 'id' when calling VoiceApi.get_sip_trunk"
706
+ end
707
+ # resource path
708
+ local_var_path = '/v1/phone-numbers/sip-trunks/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
709
+
710
+ # query parameters
711
+ query_params = opts[:query_params] || {}
712
+
713
+ # header parameters
714
+ header_params = opts[:header_params] || {}
715
+ # HTTP header 'Accept' (if needed)
716
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
717
+
718
+ # form parameters
719
+ form_params = opts[:form_params] || {}
720
+
721
+ # http body (model)
722
+ post_body = opts[:debug_body]
723
+
724
+ # return_type
725
+ return_type = opts[:debug_return_type] || 'GetSipTrunk200Response'
726
+
727
+ # auth_names
728
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
729
+
730
+ new_options = opts.merge(
731
+ :operation => :"VoiceApi.get_sip_trunk",
732
+ :header_params => header_params,
733
+ :query_params => query_params,
734
+ :form_params => form_params,
735
+ :body => post_body,
736
+ :auth_names => auth_names,
737
+ :return_type => return_type
738
+ )
739
+
740
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
741
+ if @api_client.config.debugging
742
+ @api_client.config.logger.debug "API called: VoiceApi#get_sip_trunk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
743
+ end
744
+ return data, status_code, headers
745
+ end
746
+
418
747
  # Get a phone call
419
748
  # Full call detail, including the transcript segments when transcription was on.
420
749
  # @param id [String]
@@ -629,6 +958,61 @@ module Zernio
629
958
  return data, status_code, headers
630
959
  end
631
960
 
961
+ # List SIP trunks
962
+ # @param [Hash] opts the optional parameters
963
+ # @return [ListSipTrunks200Response]
964
+ def list_sip_trunks(opts = {})
965
+ data, _status_code, _headers = list_sip_trunks_with_http_info(opts)
966
+ data
967
+ end
968
+
969
+ # List SIP trunks
970
+ # @param [Hash] opts the optional parameters
971
+ # @return [Array<(ListSipTrunks200Response, Integer, Hash)>] ListSipTrunks200Response data, response status code and response headers
972
+ def list_sip_trunks_with_http_info(opts = {})
973
+ if @api_client.config.debugging
974
+ @api_client.config.logger.debug 'Calling API: VoiceApi.list_sip_trunks ...'
975
+ end
976
+ # resource path
977
+ local_var_path = '/v1/phone-numbers/sip-trunks'
978
+
979
+ # query parameters
980
+ query_params = opts[:query_params] || {}
981
+
982
+ # header parameters
983
+ header_params = opts[:header_params] || {}
984
+ # HTTP header 'Accept' (if needed)
985
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
986
+
987
+ # form parameters
988
+ form_params = opts[:form_params] || {}
989
+
990
+ # http body (model)
991
+ post_body = opts[:debug_body]
992
+
993
+ # return_type
994
+ return_type = opts[:debug_return_type] || 'ListSipTrunks200Response'
995
+
996
+ # auth_names
997
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
998
+
999
+ new_options = opts.merge(
1000
+ :operation => :"VoiceApi.list_sip_trunks",
1001
+ :header_params => header_params,
1002
+ :query_params => query_params,
1003
+ :form_params => form_params,
1004
+ :body => post_body,
1005
+ :auth_names => auth_names,
1006
+ :return_type => return_type
1007
+ )
1008
+
1009
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1010
+ if @api_client.config.debugging
1011
+ @api_client.config.logger.debug "API called: VoiceApi#list_sip_trunks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1012
+ end
1013
+ return data, status_code, headers
1014
+ end
1015
+
632
1016
  # List phone calls
633
1017
  # Your PSTN voice calls (inbound + outbound), newest first. Cursor pagination: pass the returned `nextCursor` as `before` for the next page. For a history that also includes WhatsApp calls, use `GET /v1/calls`.
634
1018
  # @param [Hash] opts the optional parameters
@@ -717,6 +1101,69 @@ module Zernio
717
1101
  return data, status_code, headers
718
1102
  end
719
1103
 
1104
+ # Rotate a SIP trunk's password
1105
+ # Mints a new digest password on the trunk. The old password stops working immediately, so update the destination platform right away.
1106
+ # @param id [String]
1107
+ # @param [Hash] opts the optional parameters
1108
+ # @return [RotateSipTrunkCredentials200Response]
1109
+ def rotate_sip_trunk_credentials(id, opts = {})
1110
+ data, _status_code, _headers = rotate_sip_trunk_credentials_with_http_info(id, opts)
1111
+ data
1112
+ end
1113
+
1114
+ # Rotate a SIP trunk&#39;s password
1115
+ # Mints a new digest password on the trunk. The old password stops working immediately, so update the destination platform right away.
1116
+ # @param id [String]
1117
+ # @param [Hash] opts the optional parameters
1118
+ # @return [Array<(RotateSipTrunkCredentials200Response, Integer, Hash)>] RotateSipTrunkCredentials200Response data, response status code and response headers
1119
+ def rotate_sip_trunk_credentials_with_http_info(id, opts = {})
1120
+ if @api_client.config.debugging
1121
+ @api_client.config.logger.debug 'Calling API: VoiceApi.rotate_sip_trunk_credentials ...'
1122
+ end
1123
+ # verify the required parameter 'id' is set
1124
+ if @api_client.config.client_side_validation && id.nil?
1125
+ fail ArgumentError, "Missing the required parameter 'id' when calling VoiceApi.rotate_sip_trunk_credentials"
1126
+ end
1127
+ # resource path
1128
+ local_var_path = '/v1/phone-numbers/sip-trunks/{id}/rotate-credentials'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
1129
+
1130
+ # query parameters
1131
+ query_params = opts[:query_params] || {}
1132
+
1133
+ # header parameters
1134
+ header_params = opts[:header_params] || {}
1135
+ # HTTP header 'Accept' (if needed)
1136
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1137
+
1138
+ # form parameters
1139
+ form_params = opts[:form_params] || {}
1140
+
1141
+ # http body (model)
1142
+ post_body = opts[:debug_body]
1143
+
1144
+ # return_type
1145
+ return_type = opts[:debug_return_type] || 'RotateSipTrunkCredentials200Response'
1146
+
1147
+ # auth_names
1148
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1149
+
1150
+ new_options = opts.merge(
1151
+ :operation => :"VoiceApi.rotate_sip_trunk_credentials",
1152
+ :header_params => header_params,
1153
+ :query_params => query_params,
1154
+ :form_params => form_params,
1155
+ :body => post_body,
1156
+ :auth_names => auth_names,
1157
+ :return_type => return_type
1158
+ )
1159
+
1160
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1161
+ if @api_client.config.debugging
1162
+ @api_client.config.logger.debug "API called: VoiceApi#rotate_sip_trunk_credentials\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1163
+ end
1164
+ return data, status_code, headers
1165
+ end
1166
+
720
1167
  # Blind-transfer a live call
721
1168
  # Moves the call's current leg to a new destination (a phone number or a SIP endpoint). This is a BLIND transfer: control of the leg is handed off and the call ends normally when the transferred leg hangs up. The caller ID presented on the transfer leg is always your own number.
722
1169
  # @param id [String]
@@ -0,0 +1,165 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ class AttachNumberToSipTrunk200Response < ApiModelBase
18
+ attr_accessor :attached
19
+
20
+ attr_accessor :phone_number
21
+
22
+ attr_accessor :trunk_id
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'attached' => :'attached',
28
+ :'phone_number' => :'phoneNumber',
29
+ :'trunk_id' => :'trunkId'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'attached' => :'Boolean',
47
+ :'phone_number' => :'String',
48
+ :'trunk_id' => :'String'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::AttachNumberToSipTrunk200Response` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::AttachNumberToSipTrunk200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'attached')
75
+ self.attached = attributes[:'attached']
76
+ end
77
+
78
+ if attributes.key?(:'phone_number')
79
+ self.phone_number = attributes[:'phone_number']
80
+ end
81
+
82
+ if attributes.key?(:'trunk_id')
83
+ self.trunk_id = attributes[:'trunk_id']
84
+ end
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properties with the reasons
89
+ def list_invalid_properties
90
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
91
+ invalid_properties = Array.new
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ warn '[DEPRECATED] the `valid?` method is obsolete'
99
+ true
100
+ end
101
+
102
+ # Checks equality by comparing each attribute.
103
+ # @param [Object] Object to be compared
104
+ def ==(o)
105
+ return true if self.equal?(o)
106
+ self.class == o.class &&
107
+ attached == o.attached &&
108
+ phone_number == o.phone_number &&
109
+ trunk_id == o.trunk_id
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [attached, phone_number, trunk_id].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def self.build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ attributes = attributes.transform_keys(&:to_sym)
130
+ transformed_hash = {}
131
+ openapi_types.each_pair do |key, type|
132
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = nil
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[attribute_map[key]].is_a?(Array)
138
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
139
+ end
140
+ elsif !attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
142
+ end
143
+ end
144
+ new(transformed_hash)
145
+ end
146
+
147
+ # Returns the object in the form of hash
148
+ # @return [Hash] Returns the object in the form of hash
149
+ def to_hash
150
+ hash = {}
151
+ self.class.attribute_map.each_pair do |attr, param|
152
+ value = self.send(attr)
153
+ if value.nil?
154
+ is_nullable = self.class.openapi_nullable.include?(attr)
155
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
156
+ end
157
+
158
+ hash[param] = _to_hash(value)
159
+ end
160
+ hash
161
+ end
162
+
163
+ end
164
+
165
+ end