late-sdk 0.0.726 → 0.0.728

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 (60) 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/CreatePostRequest.md +1 -1
  6. data/docs/CreateSipTrunk201Response.md +34 -0
  7. data/docs/CreateSipTrunk201ResponseTermination.md +20 -0
  8. data/docs/CreateSipTrunkRequest.md +24 -0
  9. data/docs/DetachNumberFromSipTrunk200Response.md +20 -0
  10. data/docs/GetPhoneNumber200ResponsePhoneNumber.md +3 -1
  11. data/docs/GetSipTrunk200Response.md +34 -0
  12. data/docs/GetSipTrunk200ResponseNumbersInner.md +20 -0
  13. data/docs/LinkedInPlatformData.md +1 -1
  14. data/docs/ListPhoneNumbers200ResponseNumbersInner.md +2 -0
  15. data/docs/ListSipTrunks200Response.md +20 -0
  16. data/docs/ListSipTrunks200ResponseTrunksInner.md +32 -0
  17. data/docs/ListSipTrunks200ResponseTrunksInnerTermination.md +20 -0
  18. data/docs/PostsApi.md +1 -1
  19. data/docs/RotateSipTrunkCredentials200Response.md +20 -0
  20. data/docs/VoiceApi.md +485 -0
  21. data/lib/zernio-sdk/api/posts_api.rb +2 -2
  22. data/lib/zernio-sdk/api/voice_api.rb +447 -0
  23. data/lib/zernio-sdk/models/attach_number_to_sip_trunk200_response.rb +165 -0
  24. data/lib/zernio-sdk/models/attach_number_to_sip_trunk_request.rb +165 -0
  25. data/lib/zernio-sdk/models/create_post_request.rb +1 -1
  26. data/lib/zernio-sdk/models/create_sip_trunk201_response.rb +255 -0
  27. data/lib/zernio-sdk/models/create_sip_trunk201_response_termination.rb +158 -0
  28. data/lib/zernio-sdk/models/create_sip_trunk_request.rb +283 -0
  29. data/lib/zernio-sdk/models/detach_number_from_sip_trunk200_response.rb +157 -0
  30. data/lib/zernio-sdk/models/get_phone_number200_response_phone_number.rb +15 -4
  31. data/lib/zernio-sdk/models/get_sip_trunk200_response.rb +256 -0
  32. data/lib/zernio-sdk/models/get_sip_trunk200_response_numbers_inner.rb +157 -0
  33. data/lib/zernio-sdk/models/linked_in_platform_data.rb +1 -1
  34. data/lib/zernio-sdk/models/list_phone_numbers200_response_numbers_inner.rb +12 -1
  35. data/lib/zernio-sdk/models/list_sip_trunks200_response.rb +159 -0
  36. data/lib/zernio-sdk/models/list_sip_trunks200_response_trunks_inner.rb +245 -0
  37. data/lib/zernio-sdk/models/list_sip_trunks200_response_trunks_inner_termination.rb +156 -0
  38. data/lib/zernio-sdk/models/rotate_sip_trunk_credentials200_response.rb +156 -0
  39. data/lib/zernio-sdk/version.rb +1 -1
  40. data/lib/zernio-sdk.rb +12 -0
  41. data/openapi.yaml +271 -3
  42. data/spec/api/posts_api_spec.rb +1 -1
  43. data/spec/api/voice_api_spec.rb +82 -0
  44. data/spec/models/attach_number_to_sip_trunk200_response_spec.rb +48 -0
  45. data/spec/models/attach_number_to_sip_trunk_request_spec.rb +36 -0
  46. data/spec/models/create_sip_trunk201_response_spec.rb +88 -0
  47. data/spec/models/create_sip_trunk201_response_termination_spec.rb +42 -0
  48. data/spec/models/create_sip_trunk_request_spec.rb +58 -0
  49. data/spec/models/detach_number_from_sip_trunk200_response_spec.rb +42 -0
  50. data/spec/models/get_phone_number200_response_phone_number_spec.rb +6 -0
  51. data/spec/models/get_sip_trunk200_response_numbers_inner_spec.rb +42 -0
  52. data/spec/models/get_sip_trunk200_response_spec.rb +88 -0
  53. data/spec/models/list_phone_numbers200_response_numbers_inner_spec.rb +6 -0
  54. data/spec/models/list_sip_trunks200_response_spec.rb +42 -0
  55. data/spec/models/list_sip_trunks200_response_trunks_inner_spec.rb +82 -0
  56. data/spec/models/list_sip_trunks200_response_trunks_inner_termination_spec.rb +42 -0
  57. data/spec/models/rotate_sip_trunk_credentials200_response_spec.rb +42 -0
  58. data/zernio-sdk-0.0.728.gem +0 -0
  59. metadata +51 -3
  60. data/zernio-sdk-0.0.726.gem +0 -0
@@ -0,0 +1,256 @@
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 GetSipTrunk200Response < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :label
21
+
22
+ attr_accessor :sip_host
23
+
24
+ attr_accessor :sip_port
25
+
26
+ attr_accessor :transport
27
+
28
+ attr_accessor :termination
29
+
30
+ attr_accessor :numbers_attached
31
+
32
+ attr_accessor :created_at
33
+
34
+ attr_accessor :numbers
35
+
36
+ class EnumAttributeValidator
37
+ attr_reader :datatype
38
+ attr_reader :allowable_values
39
+
40
+ def initialize(datatype, allowable_values)
41
+ @allowable_values = allowable_values.map do |value|
42
+ case datatype.to_s
43
+ when /Integer/i
44
+ value.to_i
45
+ when /Float/i
46
+ value.to_f
47
+ else
48
+ value
49
+ end
50
+ end
51
+ end
52
+
53
+ def valid?(value)
54
+ !value || allowable_values.include?(value)
55
+ end
56
+ end
57
+
58
+ # Attribute mapping from ruby-style variable name to JSON key.
59
+ def self.attribute_map
60
+ {
61
+ :'id' => :'id',
62
+ :'label' => :'label',
63
+ :'sip_host' => :'sipHost',
64
+ :'sip_port' => :'sipPort',
65
+ :'transport' => :'transport',
66
+ :'termination' => :'termination',
67
+ :'numbers_attached' => :'numbersAttached',
68
+ :'created_at' => :'createdAt',
69
+ :'numbers' => :'numbers'
70
+ }
71
+ end
72
+
73
+ # Returns attribute mapping this model knows about
74
+ def self.acceptable_attribute_map
75
+ attribute_map
76
+ end
77
+
78
+ # Returns all the JSON keys this model knows about
79
+ def self.acceptable_attributes
80
+ acceptable_attribute_map.values
81
+ end
82
+
83
+ # Attribute type mapping.
84
+ def self.openapi_types
85
+ {
86
+ :'id' => :'String',
87
+ :'label' => :'String',
88
+ :'sip_host' => :'String',
89
+ :'sip_port' => :'Integer',
90
+ :'transport' => :'String',
91
+ :'termination' => :'ListSipTrunks200ResponseTrunksInnerTermination',
92
+ :'numbers_attached' => :'Integer',
93
+ :'created_at' => :'Time',
94
+ :'numbers' => :'Array<GetSipTrunk200ResponseNumbersInner>'
95
+ }
96
+ end
97
+
98
+ # List of attributes with nullable: true
99
+ def self.openapi_nullable
100
+ Set.new([
101
+ :'created_at',
102
+ ])
103
+ end
104
+
105
+ # Initializes the object
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ def initialize(attributes = {})
108
+ if (!attributes.is_a?(Hash))
109
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetSipTrunk200Response` initialize method"
110
+ end
111
+
112
+ # check to see if the attribute exists and convert string to symbol for hash key
113
+ acceptable_attribute_map = self.class.acceptable_attribute_map
114
+ attributes = attributes.each_with_object({}) { |(k, v), h|
115
+ if (!acceptable_attribute_map.key?(k.to_sym))
116
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetSipTrunk200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
117
+ end
118
+ h[k.to_sym] = v
119
+ }
120
+
121
+ if attributes.key?(:'id')
122
+ self.id = attributes[:'id']
123
+ end
124
+
125
+ if attributes.key?(:'label')
126
+ self.label = attributes[:'label']
127
+ end
128
+
129
+ if attributes.key?(:'sip_host')
130
+ self.sip_host = attributes[:'sip_host']
131
+ end
132
+
133
+ if attributes.key?(:'sip_port')
134
+ self.sip_port = attributes[:'sip_port']
135
+ end
136
+
137
+ if attributes.key?(:'transport')
138
+ self.transport = attributes[:'transport']
139
+ end
140
+
141
+ if attributes.key?(:'termination')
142
+ self.termination = attributes[:'termination']
143
+ end
144
+
145
+ if attributes.key?(:'numbers_attached')
146
+ self.numbers_attached = attributes[:'numbers_attached']
147
+ end
148
+
149
+ if attributes.key?(:'created_at')
150
+ self.created_at = attributes[:'created_at']
151
+ end
152
+
153
+ if attributes.key?(:'numbers')
154
+ if (value = attributes[:'numbers']).is_a?(Array)
155
+ self.numbers = value
156
+ end
157
+ end
158
+ end
159
+
160
+ # Show invalid properties with the reasons. Usually used together with valid?
161
+ # @return Array for valid properties with the reasons
162
+ def list_invalid_properties
163
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
164
+ invalid_properties = Array.new
165
+ invalid_properties
166
+ end
167
+
168
+ # Check to see if the all the properties in the model are valid
169
+ # @return true if the model is valid
170
+ def valid?
171
+ warn '[DEPRECATED] the `valid?` method is obsolete'
172
+ transport_validator = EnumAttributeValidator.new('String', ["tls", "tcp", "udp"])
173
+ return false unless transport_validator.valid?(@transport)
174
+ true
175
+ end
176
+
177
+ # Custom attribute writer method checking allowed values (enum).
178
+ # @param [Object] transport Object to be assigned
179
+ def transport=(transport)
180
+ validator = EnumAttributeValidator.new('String', ["tls", "tcp", "udp"])
181
+ unless validator.valid?(transport)
182
+ fail ArgumentError, "invalid value for \"transport\", must be one of #{validator.allowable_values}."
183
+ end
184
+ @transport = transport
185
+ end
186
+
187
+ # Checks equality by comparing each attribute.
188
+ # @param [Object] Object to be compared
189
+ def ==(o)
190
+ return true if self.equal?(o)
191
+ self.class == o.class &&
192
+ id == o.id &&
193
+ label == o.label &&
194
+ sip_host == o.sip_host &&
195
+ sip_port == o.sip_port &&
196
+ transport == o.transport &&
197
+ termination == o.termination &&
198
+ numbers_attached == o.numbers_attached &&
199
+ created_at == o.created_at &&
200
+ numbers == o.numbers
201
+ end
202
+
203
+ # @see the `==` method
204
+ # @param [Object] Object to be compared
205
+ def eql?(o)
206
+ self == o
207
+ end
208
+
209
+ # Calculates hash code according to all attributes.
210
+ # @return [Integer] Hash code
211
+ def hash
212
+ [id, label, sip_host, sip_port, transport, termination, numbers_attached, created_at, numbers].hash
213
+ end
214
+
215
+ # Builds the object from hash
216
+ # @param [Hash] attributes Model attributes in the form of hash
217
+ # @return [Object] Returns the model itself
218
+ def self.build_from_hash(attributes)
219
+ return nil unless attributes.is_a?(Hash)
220
+ attributes = attributes.transform_keys(&:to_sym)
221
+ transformed_hash = {}
222
+ openapi_types.each_pair do |key, type|
223
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
224
+ transformed_hash["#{key}"] = nil
225
+ elsif type =~ /\AArray<(.*)>/i
226
+ # check to ensure the input is an array given that the attribute
227
+ # is documented as an array but the input is not
228
+ if attributes[attribute_map[key]].is_a?(Array)
229
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
230
+ end
231
+ elsif !attributes[attribute_map[key]].nil?
232
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
233
+ end
234
+ end
235
+ new(transformed_hash)
236
+ end
237
+
238
+ # Returns the object in the form of hash
239
+ # @return [Hash] Returns the object in the form of hash
240
+ def to_hash
241
+ hash = {}
242
+ self.class.attribute_map.each_pair do |attr, param|
243
+ value = self.send(attr)
244
+ if value.nil?
245
+ is_nullable = self.class.openapi_nullable.include?(attr)
246
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
247
+ end
248
+
249
+ hash[param] = _to_hash(value)
250
+ end
251
+ hash
252
+ end
253
+
254
+ end
255
+
256
+ 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 GetSipTrunk200ResponseNumbersInner < ApiModelBase
18
+ # Phone number record ID.
19
+ attr_accessor :id
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
+ :'id' => :'id',
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
+ :'id' => :'String',
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::GetSipTrunk200ResponseNumbersInner` 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::GetSipTrunk200ResponseNumbersInner`. 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?(:'id')
72
+ self.id = attributes[:'id']
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
+ id == o.id &&
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
+ [id, 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
@@ -28,7 +28,7 @@ module Zernio
28
28
  # Set to true to disable automatic link previews for URLs in the post content (default is false)
29
29
  attr_accessor :disable_link_preview
30
30
 
31
- # LinkedIn post link to repost (use the post's \"Copy link to post\" action), or a urn:li:share / urn:li:ugcPost / urn:li:groupPost URN. With content, the published post is a quote-reshare: your text is the commentary and the original is embedded underneath (LinkedIn's \"repost with your thoughts\"). Leave content empty (and omit customContent) to publish a plain repost with no text, LinkedIn's one-click \"Repost\". Mutually exclusive with media. Works on personal profiles and organization pages.
31
+ # LinkedIn post link to repost (use the post's \"Copy link to post\" action), or a urn:li:share / urn:li:ugcPost / urn:li:groupPost URN. The published post is always a reshare authored by your account with the original embedded underneath: with content your text is the commentary (LinkedIn's \"repost with your thoughts\"), and with no content it publishes as a text-free reshare. Note that a text-free reshare is NOT LinkedIn's one-click \"Repost\" (the feed treatment where the original author stays the author); LinkedIn's API exposes no way to create that, so the post still appears authored by you with the original embedded. Mutually exclusive with media. Works on personal profiles and organization pages.
32
32
  attr_accessor :reshare_url
33
33
 
34
34
  attr_accessor :geo_restriction
@@ -35,6 +35,9 @@ module Zernio
35
35
  # False for numbers you brought yourself (connected via Meta embedded signup) — they live on your own carrier, so SMS/Calls can't be enabled on them.
36
36
  attr_accessor :hosted_by_zernio
37
37
 
38
+ # 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.
39
+ attr_accessor :sip_trunk_id
40
+
38
41
  attr_accessor :profile_id
39
42
 
40
43
  attr_accessor :provisioned_at
@@ -91,6 +94,7 @@ module Zernio
91
94
  :'telnyx_order_id' => :'telnyxOrderId',
92
95
  :'monthly_cents' => :'monthlyCents',
93
96
  :'hosted_by_zernio' => :'hostedByZernio',
97
+ :'sip_trunk_id' => :'sipTrunkId',
94
98
  :'profile_id' => :'profileId',
95
99
  :'provisioned_at' => :'provisionedAt',
96
100
  :'meta_preverified_id' => :'metaPreverifiedId',
@@ -125,6 +129,7 @@ module Zernio
125
129
  :'telnyx_order_id' => :'String',
126
130
  :'monthly_cents' => :'Integer',
127
131
  :'hosted_by_zernio' => :'Boolean',
132
+ :'sip_trunk_id' => :'String',
128
133
  :'profile_id' => :'Object',
129
134
  :'provisioned_at' => :'Time',
130
135
  :'meta_preverified_id' => :'String',
@@ -143,6 +148,7 @@ module Zernio
143
148
  Set.new([
144
149
  :'registrant_name',
145
150
  :'telnyx_order_id',
151
+ :'sip_trunk_id',
146
152
  :'onfido_verification_url',
147
153
  :'end_user_first_name',
148
154
  :'end_user_last_name',
@@ -198,6 +204,10 @@ module Zernio
198
204
  self.hosted_by_zernio = attributes[:'hosted_by_zernio']
199
205
  end
200
206
 
207
+ if attributes.key?(:'sip_trunk_id')
208
+ self.sip_trunk_id = attributes[:'sip_trunk_id']
209
+ end
210
+
201
211
  if attributes.key?(:'profile_id')
202
212
  self.profile_id = attributes[:'profile_id']
203
213
  end
@@ -279,6 +289,7 @@ module Zernio
279
289
  telnyx_order_id == o.telnyx_order_id &&
280
290
  monthly_cents == o.monthly_cents &&
281
291
  hosted_by_zernio == o.hosted_by_zernio &&
292
+ sip_trunk_id == o.sip_trunk_id &&
282
293
  profile_id == o.profile_id &&
283
294
  provisioned_at == o.provisioned_at &&
284
295
  meta_preverified_id == o.meta_preverified_id &&
@@ -300,7 +311,7 @@ module Zernio
300
311
  # Calculates hash code according to all attributes.
301
312
  # @return [Integer] Hash code
302
313
  def hash
303
- [_id, phone_number, country, status, registrant_name, telnyx_order_id, monthly_cents, hosted_by_zernio, profile_id, provisioned_at, meta_preverified_id, meta_verification_status, onfido_verification_url, end_user_first_name, end_user_last_name, regulatory_decline_reason, calling_enabled, created_at].hash
314
+ [_id, phone_number, country, status, registrant_name, telnyx_order_id, monthly_cents, hosted_by_zernio, sip_trunk_id, profile_id, provisioned_at, meta_preverified_id, meta_verification_status, onfido_verification_url, end_user_first_name, end_user_last_name, regulatory_decline_reason, calling_enabled, created_at].hash
304
315
  end
305
316
 
306
317
  # Builds the object from hash
@@ -0,0 +1,159 @@
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 ListSipTrunks200Response < ApiModelBase
18
+ attr_accessor :trunks
19
+
20
+ # Whether this workspace can create SIP trunks. Managing existing trunks always works.
21
+ attr_accessor :enabled
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'trunks' => :'trunks',
27
+ :'enabled' => :'enabled'
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
+ :'trunks' => :'Array<ListSipTrunks200ResponseTrunksInner>',
45
+ :'enabled' => :'Boolean'
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::ListSipTrunks200Response` 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::ListSipTrunks200Response`. 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?(:'trunks')
72
+ if (value = attributes[:'trunks']).is_a?(Array)
73
+ self.trunks = value
74
+ end
75
+ end
76
+
77
+ if attributes.key?(:'enabled')
78
+ self.enabled = attributes[:'enabled']
79
+ end
80
+ end
81
+
82
+ # Show invalid properties with the reasons. Usually used together with valid?
83
+ # @return Array for valid properties with the reasons
84
+ def list_invalid_properties
85
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
86
+ invalid_properties = Array.new
87
+ invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ warn '[DEPRECATED] the `valid?` method is obsolete'
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ trunks == o.trunks &&
103
+ enabled == o.enabled
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Integer] Hash code
114
+ def hash
115
+ [trunks, enabled].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def self.build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ attributes = attributes.transform_keys(&:to_sym)
124
+ transformed_hash = {}
125
+ openapi_types.each_pair do |key, type|
126
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
127
+ transformed_hash["#{key}"] = nil
128
+ elsif type =~ /\AArray<(.*)>/i
129
+ # check to ensure the input is an array given that the attribute
130
+ # is documented as an array but the input is not
131
+ if attributes[attribute_map[key]].is_a?(Array)
132
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
133
+ end
134
+ elsif !attributes[attribute_map[key]].nil?
135
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
136
+ end
137
+ end
138
+ new(transformed_hash)
139
+ end
140
+
141
+ # Returns the object in the form of hash
142
+ # @return [Hash] Returns the object in the form of hash
143
+ def to_hash
144
+ hash = {}
145
+ self.class.attribute_map.each_pair do |attr, param|
146
+ value = self.send(attr)
147
+ if value.nil?
148
+ is_nullable = self.class.openapi_nullable.include?(attr)
149
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
150
+ end
151
+
152
+ hash[param] = _to_hash(value)
153
+ end
154
+ hash
155
+ end
156
+
157
+ end
158
+
159
+ end