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
@@ -0,0 +1,283 @@
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 CreateSipTrunkRequest < ApiModelBase
18
+ # Display name for the trunk.
19
+ attr_accessor :label
20
+
21
+ # Fully-qualified hostname inbound calls are delivered to (e.g. sip.rtc.elevenlabs.io, sip.retellai.com).
22
+ attr_accessor :sip_host
23
+
24
+ # Defaults to 5061 for tls, 5060 otherwise.
25
+ attr_accessor :sip_port
26
+
27
+ # Signaling transport toward sipHost. Default tls (with SRTP media).
28
+ attr_accessor :transport
29
+
30
+ class EnumAttributeValidator
31
+ attr_reader :datatype
32
+ attr_reader :allowable_values
33
+
34
+ def initialize(datatype, allowable_values)
35
+ @allowable_values = allowable_values.map do |value|
36
+ case datatype.to_s
37
+ when /Integer/i
38
+ value.to_i
39
+ when /Float/i
40
+ value.to_f
41
+ else
42
+ value
43
+ end
44
+ end
45
+ end
46
+
47
+ def valid?(value)
48
+ !value || allowable_values.include?(value)
49
+ end
50
+ end
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'label' => :'label',
56
+ :'sip_host' => :'sipHost',
57
+ :'sip_port' => :'sipPort',
58
+ :'transport' => :'transport'
59
+ }
60
+ end
61
+
62
+ # Returns attribute mapping this model knows about
63
+ def self.acceptable_attribute_map
64
+ attribute_map
65
+ end
66
+
67
+ # Returns all the JSON keys this model knows about
68
+ def self.acceptable_attributes
69
+ acceptable_attribute_map.values
70
+ end
71
+
72
+ # Attribute type mapping.
73
+ def self.openapi_types
74
+ {
75
+ :'label' => :'String',
76
+ :'sip_host' => :'String',
77
+ :'sip_port' => :'Integer',
78
+ :'transport' => :'String'
79
+ }
80
+ end
81
+
82
+ # List of attributes with nullable: true
83
+ def self.openapi_nullable
84
+ Set.new([
85
+ ])
86
+ end
87
+
88
+ # Initializes the object
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ def initialize(attributes = {})
91
+ if (!attributes.is_a?(Hash))
92
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CreateSipTrunkRequest` initialize method"
93
+ end
94
+
95
+ # check to see if the attribute exists and convert string to symbol for hash key
96
+ acceptable_attribute_map = self.class.acceptable_attribute_map
97
+ attributes = attributes.each_with_object({}) { |(k, v), h|
98
+ if (!acceptable_attribute_map.key?(k.to_sym))
99
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::CreateSipTrunkRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
100
+ end
101
+ h[k.to_sym] = v
102
+ }
103
+
104
+ if attributes.key?(:'label')
105
+ self.label = attributes[:'label']
106
+ else
107
+ self.label = nil
108
+ end
109
+
110
+ if attributes.key?(:'sip_host')
111
+ self.sip_host = attributes[:'sip_host']
112
+ else
113
+ self.sip_host = nil
114
+ end
115
+
116
+ if attributes.key?(:'sip_port')
117
+ self.sip_port = attributes[:'sip_port']
118
+ end
119
+
120
+ if attributes.key?(:'transport')
121
+ self.transport = attributes[:'transport']
122
+ end
123
+ end
124
+
125
+ # Show invalid properties with the reasons. Usually used together with valid?
126
+ # @return Array for valid properties with the reasons
127
+ def list_invalid_properties
128
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
129
+ invalid_properties = Array.new
130
+ if @label.nil?
131
+ invalid_properties.push('invalid value for "label", label cannot be nil.')
132
+ end
133
+
134
+ if @label.to_s.length > 80
135
+ invalid_properties.push('invalid value for "label", the character length must be smaller than or equal to 80.')
136
+ end
137
+
138
+ if @sip_host.nil?
139
+ invalid_properties.push('invalid value for "sip_host", sip_host cannot be nil.')
140
+ end
141
+
142
+ if !@sip_port.nil? && @sip_port > 65535
143
+ invalid_properties.push('invalid value for "sip_port", must be smaller than or equal to 65535.')
144
+ end
145
+
146
+ if !@sip_port.nil? && @sip_port < 1
147
+ invalid_properties.push('invalid value for "sip_port", must be greater than or equal to 1.')
148
+ end
149
+
150
+ invalid_properties
151
+ end
152
+
153
+ # Check to see if the all the properties in the model are valid
154
+ # @return true if the model is valid
155
+ def valid?
156
+ warn '[DEPRECATED] the `valid?` method is obsolete'
157
+ return false if @label.nil?
158
+ return false if @label.to_s.length > 80
159
+ return false if @sip_host.nil?
160
+ return false if !@sip_port.nil? && @sip_port > 65535
161
+ return false if !@sip_port.nil? && @sip_port < 1
162
+ transport_validator = EnumAttributeValidator.new('String', ["tls", "tcp", "udp"])
163
+ return false unless transport_validator.valid?(@transport)
164
+ true
165
+ end
166
+
167
+ # Custom attribute writer method with validation
168
+ # @param [Object] label Value to be assigned
169
+ def label=(label)
170
+ if label.nil?
171
+ fail ArgumentError, 'label cannot be nil'
172
+ end
173
+
174
+ if label.to_s.length > 80
175
+ fail ArgumentError, 'invalid value for "label", the character length must be smaller than or equal to 80.'
176
+ end
177
+
178
+ @label = label
179
+ end
180
+
181
+ # Custom attribute writer method with validation
182
+ # @param [Object] sip_host Value to be assigned
183
+ def sip_host=(sip_host)
184
+ if sip_host.nil?
185
+ fail ArgumentError, 'sip_host cannot be nil'
186
+ end
187
+
188
+ @sip_host = sip_host
189
+ end
190
+
191
+ # Custom attribute writer method with validation
192
+ # @param [Object] sip_port Value to be assigned
193
+ def sip_port=(sip_port)
194
+ if sip_port.nil?
195
+ fail ArgumentError, 'sip_port cannot be nil'
196
+ end
197
+
198
+ if sip_port > 65535
199
+ fail ArgumentError, 'invalid value for "sip_port", must be smaller than or equal to 65535.'
200
+ end
201
+
202
+ if sip_port < 1
203
+ fail ArgumentError, 'invalid value for "sip_port", must be greater than or equal to 1.'
204
+ end
205
+
206
+ @sip_port = sip_port
207
+ end
208
+
209
+ # Custom attribute writer method checking allowed values (enum).
210
+ # @param [Object] transport Object to be assigned
211
+ def transport=(transport)
212
+ validator = EnumAttributeValidator.new('String', ["tls", "tcp", "udp"])
213
+ unless validator.valid?(transport)
214
+ fail ArgumentError, "invalid value for \"transport\", must be one of #{validator.allowable_values}."
215
+ end
216
+ @transport = transport
217
+ end
218
+
219
+ # Checks equality by comparing each attribute.
220
+ # @param [Object] Object to be compared
221
+ def ==(o)
222
+ return true if self.equal?(o)
223
+ self.class == o.class &&
224
+ label == o.label &&
225
+ sip_host == o.sip_host &&
226
+ sip_port == o.sip_port &&
227
+ transport == o.transport
228
+ end
229
+
230
+ # @see the `==` method
231
+ # @param [Object] Object to be compared
232
+ def eql?(o)
233
+ self == o
234
+ end
235
+
236
+ # Calculates hash code according to all attributes.
237
+ # @return [Integer] Hash code
238
+ def hash
239
+ [label, sip_host, sip_port, transport].hash
240
+ end
241
+
242
+ # Builds the object from hash
243
+ # @param [Hash] attributes Model attributes in the form of hash
244
+ # @return [Object] Returns the model itself
245
+ def self.build_from_hash(attributes)
246
+ return nil unless attributes.is_a?(Hash)
247
+ attributes = attributes.transform_keys(&:to_sym)
248
+ transformed_hash = {}
249
+ openapi_types.each_pair do |key, type|
250
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
251
+ transformed_hash["#{key}"] = nil
252
+ elsif type =~ /\AArray<(.*)>/i
253
+ # check to ensure the input is an array given that the attribute
254
+ # is documented as an array but the input is not
255
+ if attributes[attribute_map[key]].is_a?(Array)
256
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
257
+ end
258
+ elsif !attributes[attribute_map[key]].nil?
259
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
260
+ end
261
+ end
262
+ new(transformed_hash)
263
+ end
264
+
265
+ # Returns the object in the form of hash
266
+ # @return [Hash] Returns the object in the form of hash
267
+ def to_hash
268
+ hash = {}
269
+ self.class.attribute_map.each_pair do |attr, param|
270
+ value = self.send(attr)
271
+ if value.nil?
272
+ is_nullable = self.class.openapi_nullable.include?(attr)
273
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
274
+ end
275
+
276
+ hash[param] = _to_hash(value)
277
+ end
278
+ hash
279
+ end
280
+
281
+ end
282
+
283
+ end
@@ -0,0 +1,157 @@
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 DetachNumberFromSipTrunk200Response < ApiModelBase
18
+ # Always false after a successful detach.
19
+ attr_accessor :attached
20
+
21
+ attr_accessor :phone_number
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'attached' => :'attached',
27
+ :'phone_number' => :'phoneNumber'
28
+ }
29
+ end
30
+
31
+ # Returns attribute mapping this model knows about
32
+ def self.acceptable_attribute_map
33
+ attribute_map
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ acceptable_attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'attached' => :'Boolean',
45
+ :'phone_number' => :'String'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::DetachNumberFromSipTrunk200Response` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ acceptable_attribute_map = self.class.acceptable_attribute_map
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!acceptable_attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::DetachNumberFromSipTrunk200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'attached')
72
+ self.attached = attributes[:'attached']
73
+ end
74
+
75
+ if attributes.key?(:'phone_number')
76
+ self.phone_number = attributes[:'phone_number']
77
+ end
78
+ end
79
+
80
+ # Show invalid properties with the reasons. Usually used together with valid?
81
+ # @return Array for valid properties with the reasons
82
+ def list_invalid_properties
83
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
84
+ invalid_properties = Array.new
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ warn '[DEPRECATED] the `valid?` method is obsolete'
92
+ true
93
+ end
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] Object to be compared
97
+ def ==(o)
98
+ return true if self.equal?(o)
99
+ self.class == o.class &&
100
+ attached == o.attached &&
101
+ phone_number == o.phone_number
102
+ end
103
+
104
+ # @see the `==` method
105
+ # @param [Object] Object to be compared
106
+ def eql?(o)
107
+ self == o
108
+ end
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Integer] Hash code
112
+ def hash
113
+ [attached, phone_number].hash
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def self.build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ attributes = attributes.transform_keys(&:to_sym)
122
+ transformed_hash = {}
123
+ openapi_types.each_pair do |key, type|
124
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = nil
126
+ elsif type =~ /\AArray<(.*)>/i
127
+ # check to ensure the input is an array given that the attribute
128
+ # is documented as an array but the input is not
129
+ if attributes[attribute_map[key]].is_a?(Array)
130
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
131
+ end
132
+ elsif !attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
134
+ end
135
+ end
136
+ new(transformed_hash)
137
+ end
138
+
139
+ # Returns the object in the form of hash
140
+ # @return [Hash] Returns the object in the form of hash
141
+ def to_hash
142
+ hash = {}
143
+ self.class.attribute_map.each_pair do |attr, param|
144
+ value = self.send(attr)
145
+ if value.nil?
146
+ is_nullable = self.class.openapi_nullable.include?(attr)
147
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
148
+ end
149
+
150
+ hash[param] = _to_hash(value)
151
+ end
152
+ hash
153
+ end
154
+
155
+ end
156
+
157
+ end
@@ -39,6 +39,9 @@ module Zernio
39
39
 
40
40
  attr_accessor :provisioned_at
41
41
 
42
+ # SIP trunk the number is attached to; null when not trunked. While attached, enabling Calls or WhatsApp calling, requesting WhatsApp verification, and releasing the number all return 409.
43
+ attr_accessor :sip_trunk_id
44
+
42
45
  class EnumAttributeValidator
43
46
  attr_reader :datatype
44
47
  attr_reader :allowable_values
@@ -74,7 +77,8 @@ module Zernio
74
77
  :'end_user_first_name' => :'endUserFirstName',
75
78
  :'end_user_last_name' => :'endUserLastName',
76
79
  :'regulatory_decline_reason' => :'regulatoryDeclineReason',
77
- :'provisioned_at' => :'provisionedAt'
80
+ :'provisioned_at' => :'provisionedAt',
81
+ :'sip_trunk_id' => :'sipTrunkId'
78
82
  }
79
83
  end
80
84
 
@@ -101,7 +105,8 @@ module Zernio
101
105
  :'end_user_first_name' => :'String',
102
106
  :'end_user_last_name' => :'String',
103
107
  :'regulatory_decline_reason' => :'String',
104
- :'provisioned_at' => :'Time'
108
+ :'provisioned_at' => :'Time',
109
+ :'sip_trunk_id' => :'String'
105
110
  }
106
111
  end
107
112
 
@@ -112,6 +117,7 @@ module Zernio
112
117
  :'end_user_first_name',
113
118
  :'end_user_last_name',
114
119
  :'regulatory_decline_reason',
120
+ :'sip_trunk_id'
115
121
  ])
116
122
  end
117
123
 
@@ -174,6 +180,10 @@ module Zernio
174
180
  if attributes.key?(:'provisioned_at')
175
181
  self.provisioned_at = attributes[:'provisioned_at']
176
182
  end
183
+
184
+ if attributes.key?(:'sip_trunk_id')
185
+ self.sip_trunk_id = attributes[:'sip_trunk_id']
186
+ end
177
187
  end
178
188
 
179
189
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -218,7 +228,8 @@ module Zernio
218
228
  end_user_first_name == o.end_user_first_name &&
219
229
  end_user_last_name == o.end_user_last_name &&
220
230
  regulatory_decline_reason == o.regulatory_decline_reason &&
221
- provisioned_at == o.provisioned_at
231
+ provisioned_at == o.provisioned_at &&
232
+ sip_trunk_id == o.sip_trunk_id
222
233
  end
223
234
 
224
235
  # @see the `==` method
@@ -230,7 +241,7 @@ module Zernio
230
241
  # Calculates hash code according to all attributes.
231
242
  # @return [Integer] Hash code
232
243
  def hash
233
- [id, phone_number, status, country, meta_preverified_id, meta_verification_status, onfido_verification_url, end_user_first_name, end_user_last_name, regulatory_decline_reason, provisioned_at].hash
244
+ [id, phone_number, status, country, meta_preverified_id, meta_verification_status, onfido_verification_url, end_user_first_name, end_user_last_name, regulatory_decline_reason, provisioned_at, sip_trunk_id].hash
234
245
  end
235
246
 
236
247
  # Builds the object from hash