bandwidth-sdk 18.0.0 → 18.1.0
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/README.md +28 -1
- data/bandwidth.yml +944 -19
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +784 -152
- data/coverage/index.html +21650 -14800
- data/docs/BrtcError.md +26 -0
- data/docs/BrtcErrorResponse.md +22 -0
- data/docs/BrtcErrorSource.md +24 -0
- data/docs/BrtcLink.md +22 -0
- data/docs/CreateCall.md +2 -2
- data/docs/CreateEndpointRequestBase.md +26 -0
- data/docs/CreateEndpointResponse.md +22 -0
- data/docs/CreateEndpointResponseData.md +32 -0
- data/docs/CreateWebRtcConnectionRequest.md +28 -0
- data/docs/Device.md +24 -0
- data/docs/DeviceStatusEnum.md +15 -0
- data/docs/Endpoint.md +30 -0
- data/docs/EndpointDirectionEnum.md +15 -0
- data/docs/EndpointEvent.md +34 -0
- data/docs/EndpointEventTypeEnum.md +15 -0
- data/docs/EndpointResponse.md +22 -0
- data/docs/EndpointStatusEnum.md +15 -0
- data/docs/EndpointTypeEnum.md +15 -0
- data/docs/Endpoints.md +28 -0
- data/docs/EndpointsApi.md +395 -0
- data/docs/InboundCallback.md +2 -2
- data/docs/ListEndpointsResponse.md +24 -0
- data/docs/LookupResult.md +1 -1
- data/docs/MachineDetectionConfiguration.md +1 -1
- data/docs/MessageRequest.md +1 -1
- data/docs/Page.md +24 -0
- data/docs/RbmActionBase.md +1 -1
- data/docs/RbmSuggestionResponse.md +1 -1
- data/docs/SipConnectionMetadata.md +24 -0
- data/docs/SipCredentials.md +20 -0
- data/docs/StatusCallback.md +1 -1
- data/docs/SyncLookupRequest.md +3 -1
- data/docs/UpdateCall.md +1 -1
- data/docs/WebhookSubscriptionError.md +22 -0
- data/docs/WebhookSubscriptionsListBody.md +1 -1
- data/lib/bandwidth-sdk/api/endpoints_api.rb +397 -0
- data/lib/bandwidth-sdk/configuration.rb +30 -0
- data/lib/bandwidth-sdk/models/brtc_error.rb +219 -0
- data/lib/bandwidth-sdk/models/brtc_error_response.rb +204 -0
- data/lib/bandwidth-sdk/models/brtc_error_source.rb +176 -0
- data/lib/bandwidth-sdk/models/brtc_link.rb +166 -0
- data/lib/bandwidth-sdk/models/create_call.rb +7 -7
- data/lib/bandwidth-sdk/models/create_endpoint_request_base.rb +250 -0
- data/lib/bandwidth-sdk/models/create_endpoint_response.rb +218 -0
- data/lib/bandwidth-sdk/models/create_endpoint_response_data.rb +356 -0
- data/lib/bandwidth-sdk/models/create_web_rtc_connection_request.rb +266 -0
- data/lib/bandwidth-sdk/models/device.rb +258 -0
- data/lib/bandwidth-sdk/models/device_status_enum.rb +40 -0
- data/lib/bandwidth-sdk/models/endpoint.rb +329 -0
- data/lib/bandwidth-sdk/models/endpoint_direction_enum.rb +41 -0
- data/lib/bandwidth-sdk/models/endpoint_event.rb +381 -0
- data/lib/bandwidth-sdk/models/endpoint_event_type_enum.rb +40 -0
- data/lib/bandwidth-sdk/models/endpoint_response.rb +218 -0
- data/lib/bandwidth-sdk/models/endpoint_status_enum.rb +40 -0
- data/lib/bandwidth-sdk/models/endpoint_type_enum.rb +39 -0
- data/lib/bandwidth-sdk/models/endpoints.rb +311 -0
- data/lib/bandwidth-sdk/models/inbound_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/list_endpoints_response.rb +229 -0
- data/lib/bandwidth-sdk/models/lookup_result.rb +1 -1
- data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +1 -1
- data/lib/bandwidth-sdk/models/message_request.rb +1 -1
- data/lib/bandwidth-sdk/models/page.rb +259 -0
- data/lib/bandwidth-sdk/models/sip_connection_metadata.rb +175 -0
- data/lib/bandwidth-sdk/models/sip_credentials.rb +156 -0
- data/lib/bandwidth-sdk/models/status_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/sync_lookup_request.rb +35 -4
- data/lib/bandwidth-sdk/models/update_call.rb +6 -6
- data/lib/bandwidth-sdk/models/webhook_subscription_error.rb +165 -0
- data/lib/bandwidth-sdk/models/webhook_subscriptions_list_body.rb +1 -1
- data/lib/bandwidth-sdk/version.rb +1 -1
- data/lib/bandwidth-sdk.rb +24 -1
- data/spec/smoke/endpoints_api_spec.rb +148 -0
- data/spec/unit/api/endpoints_api_spec.rb +172 -0
- data/spec/unit/api/phone_number_lookup_api_spec.rb +2 -0
- metadata +104 -52
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Bandwidth
|
|
3
|
+
|
|
4
|
+
#Bandwidth's Communication APIs
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: letstalk@bandwidth.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.17.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Bandwidth
|
|
17
|
+
class CreateEndpointResponseData < ApiModelBase
|
|
18
|
+
# The unique ID of the endpoint.
|
|
19
|
+
attr_accessor :endpoint_id
|
|
20
|
+
|
|
21
|
+
attr_accessor :type
|
|
22
|
+
|
|
23
|
+
attr_accessor :status
|
|
24
|
+
|
|
25
|
+
# The time the endpoint was created. In ISO-8601 format.
|
|
26
|
+
attr_accessor :creation_timestamp
|
|
27
|
+
|
|
28
|
+
# The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours.
|
|
29
|
+
attr_accessor :expiration_timestamp
|
|
30
|
+
|
|
31
|
+
# A tag for the endpoint.
|
|
32
|
+
attr_accessor :tag
|
|
33
|
+
|
|
34
|
+
attr_accessor :devices
|
|
35
|
+
|
|
36
|
+
# The json web token specific to the endpoint. Used to authenticate the client with the media gateway.
|
|
37
|
+
attr_accessor :token
|
|
38
|
+
|
|
39
|
+
class EnumAttributeValidator
|
|
40
|
+
attr_reader :datatype
|
|
41
|
+
attr_reader :allowable_values
|
|
42
|
+
|
|
43
|
+
def initialize(datatype, allowable_values)
|
|
44
|
+
@allowable_values = allowable_values.map do |value|
|
|
45
|
+
case datatype.to_s
|
|
46
|
+
when /Integer/i
|
|
47
|
+
value.to_i
|
|
48
|
+
when /Float/i
|
|
49
|
+
value.to_f
|
|
50
|
+
else
|
|
51
|
+
value
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def valid?(value)
|
|
57
|
+
!value || allowable_values.include?(value)
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
62
|
+
def self.attribute_map
|
|
63
|
+
{
|
|
64
|
+
:'endpoint_id' => :'endpointId',
|
|
65
|
+
:'type' => :'type',
|
|
66
|
+
:'status' => :'status',
|
|
67
|
+
:'creation_timestamp' => :'creationTimestamp',
|
|
68
|
+
:'expiration_timestamp' => :'expirationTimestamp',
|
|
69
|
+
:'tag' => :'tag',
|
|
70
|
+
:'devices' => :'devices',
|
|
71
|
+
:'token' => :'token'
|
|
72
|
+
}
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Returns attribute mapping this model knows about
|
|
76
|
+
def self.acceptable_attribute_map
|
|
77
|
+
attribute_map
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Returns all the JSON keys this model knows about
|
|
81
|
+
def self.acceptable_attributes
|
|
82
|
+
acceptable_attribute_map.values
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Attribute type mapping.
|
|
86
|
+
def self.openapi_types
|
|
87
|
+
{
|
|
88
|
+
:'endpoint_id' => :'String',
|
|
89
|
+
:'type' => :'EndpointTypeEnum',
|
|
90
|
+
:'status' => :'EndpointStatusEnum',
|
|
91
|
+
:'creation_timestamp' => :'Time',
|
|
92
|
+
:'expiration_timestamp' => :'Time',
|
|
93
|
+
:'tag' => :'String',
|
|
94
|
+
:'devices' => :'Array<Device>',
|
|
95
|
+
:'token' => :'String'
|
|
96
|
+
}
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# List of attributes with nullable: true
|
|
100
|
+
def self.openapi_nullable
|
|
101
|
+
Set.new([
|
|
102
|
+
])
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# List of class defined in allOf (OpenAPI v3)
|
|
106
|
+
def self.openapi_all_of
|
|
107
|
+
[
|
|
108
|
+
:'Endpoint'
|
|
109
|
+
]
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Initializes the object
|
|
113
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
114
|
+
def initialize(attributes = {})
|
|
115
|
+
if (!attributes.is_a?(Hash))
|
|
116
|
+
fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CreateEndpointResponseData` initialize method'
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
120
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
121
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
122
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
123
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateEndpointResponseData`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
124
|
+
end
|
|
125
|
+
h[k.to_sym] = v
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if attributes.key?(:'endpoint_id')
|
|
129
|
+
self.endpoint_id = attributes[:'endpoint_id']
|
|
130
|
+
else
|
|
131
|
+
self.endpoint_id = nil
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if attributes.key?(:'type')
|
|
135
|
+
self.type = attributes[:'type']
|
|
136
|
+
else
|
|
137
|
+
self.type = nil
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if attributes.key?(:'status')
|
|
141
|
+
self.status = attributes[:'status']
|
|
142
|
+
else
|
|
143
|
+
self.status = nil
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
if attributes.key?(:'creation_timestamp')
|
|
147
|
+
self.creation_timestamp = attributes[:'creation_timestamp']
|
|
148
|
+
else
|
|
149
|
+
self.creation_timestamp = nil
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if attributes.key?(:'expiration_timestamp')
|
|
153
|
+
self.expiration_timestamp = attributes[:'expiration_timestamp']
|
|
154
|
+
else
|
|
155
|
+
self.expiration_timestamp = nil
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
if attributes.key?(:'tag')
|
|
159
|
+
self.tag = attributes[:'tag']
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
if attributes.key?(:'devices')
|
|
163
|
+
if (value = attributes[:'devices']).is_a?(Array)
|
|
164
|
+
self.devices = value
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
if attributes.key?(:'token')
|
|
169
|
+
self.token = attributes[:'token']
|
|
170
|
+
else
|
|
171
|
+
self.token = nil
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
176
|
+
# @return Array for valid properties with the reasons
|
|
177
|
+
def list_invalid_properties
|
|
178
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
179
|
+
invalid_properties = Array.new
|
|
180
|
+
if @endpoint_id.nil?
|
|
181
|
+
invalid_properties.push('invalid value for "endpoint_id", endpoint_id cannot be nil.')
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
if @type.nil?
|
|
185
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
if @status.nil?
|
|
189
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
if @creation_timestamp.nil?
|
|
193
|
+
invalid_properties.push('invalid value for "creation_timestamp", creation_timestamp cannot be nil.')
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
if @expiration_timestamp.nil?
|
|
197
|
+
invalid_properties.push('invalid value for "expiration_timestamp", expiration_timestamp cannot be nil.')
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
if @token.nil?
|
|
201
|
+
invalid_properties.push('invalid value for "token", token cannot be nil.')
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
invalid_properties
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Check to see if the all the properties in the model are valid
|
|
208
|
+
# @return true if the model is valid
|
|
209
|
+
def valid?
|
|
210
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
211
|
+
return false if @endpoint_id.nil?
|
|
212
|
+
return false if @type.nil?
|
|
213
|
+
return false if @status.nil?
|
|
214
|
+
return false if @creation_timestamp.nil?
|
|
215
|
+
return false if @expiration_timestamp.nil?
|
|
216
|
+
return false if @token.nil?
|
|
217
|
+
true
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# Custom attribute writer method with validation
|
|
221
|
+
# @param [Object] endpoint_id Value to be assigned
|
|
222
|
+
def endpoint_id=(endpoint_id)
|
|
223
|
+
if endpoint_id.nil?
|
|
224
|
+
fail ArgumentError, 'endpoint_id cannot be nil'
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
@endpoint_id = endpoint_id
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
# Custom attribute writer method with validation
|
|
231
|
+
# @param [Object] type Value to be assigned
|
|
232
|
+
def type=(type)
|
|
233
|
+
if type.nil?
|
|
234
|
+
fail ArgumentError, 'type cannot be nil'
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
@type = type
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
# Custom attribute writer method with validation
|
|
241
|
+
# @param [Object] status Value to be assigned
|
|
242
|
+
def status=(status)
|
|
243
|
+
if status.nil?
|
|
244
|
+
fail ArgumentError, 'status cannot be nil'
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
@status = status
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# Custom attribute writer method with validation
|
|
251
|
+
# @param [Object] creation_timestamp Value to be assigned
|
|
252
|
+
def creation_timestamp=(creation_timestamp)
|
|
253
|
+
if creation_timestamp.nil?
|
|
254
|
+
fail ArgumentError, 'creation_timestamp cannot be nil'
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
@creation_timestamp = creation_timestamp
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
# Custom attribute writer method with validation
|
|
261
|
+
# @param [Object] expiration_timestamp Value to be assigned
|
|
262
|
+
def expiration_timestamp=(expiration_timestamp)
|
|
263
|
+
if expiration_timestamp.nil?
|
|
264
|
+
fail ArgumentError, 'expiration_timestamp cannot be nil'
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
@expiration_timestamp = expiration_timestamp
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
# Custom attribute writer method with validation
|
|
271
|
+
# @param [Object] tag Value to be assigned
|
|
272
|
+
def tag=(tag)
|
|
273
|
+
if tag.nil?
|
|
274
|
+
fail ArgumentError, 'tag cannot be nil'
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
@tag = tag
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
# Custom attribute writer method with validation
|
|
281
|
+
# @param [Object] token Value to be assigned
|
|
282
|
+
def token=(token)
|
|
283
|
+
if token.nil?
|
|
284
|
+
fail ArgumentError, 'token cannot be nil'
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
@token = token
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
# Checks equality by comparing each attribute.
|
|
291
|
+
# @param [Object] Object to be compared
|
|
292
|
+
def ==(o)
|
|
293
|
+
return true if self.equal?(o)
|
|
294
|
+
self.class == o.class &&
|
|
295
|
+
endpoint_id == o.endpoint_id &&
|
|
296
|
+
type == o.type &&
|
|
297
|
+
status == o.status &&
|
|
298
|
+
creation_timestamp == o.creation_timestamp &&
|
|
299
|
+
expiration_timestamp == o.expiration_timestamp &&
|
|
300
|
+
tag == o.tag &&
|
|
301
|
+
devices == o.devices &&
|
|
302
|
+
token == o.token
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
# @see the `==` method
|
|
306
|
+
# @param [Object] Object to be compared
|
|
307
|
+
def eql?(o)
|
|
308
|
+
self == o
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
# Calculates hash code according to all attributes.
|
|
312
|
+
# @return [Integer] Hash code
|
|
313
|
+
def hash
|
|
314
|
+
[endpoint_id, type, status, creation_timestamp, expiration_timestamp, tag, devices, token].hash
|
|
315
|
+
end
|
|
316
|
+
|
|
317
|
+
# Builds the object from hash
|
|
318
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
319
|
+
# @return [Object] Returns the model itself
|
|
320
|
+
def self.build_from_hash(attributes)
|
|
321
|
+
return nil unless attributes.is_a?(Hash)
|
|
322
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
323
|
+
transformed_hash = {}
|
|
324
|
+
openapi_types.each_pair do |key, type|
|
|
325
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
326
|
+
transformed_hash["#{key}"] = nil
|
|
327
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
328
|
+
# check to ensure the input is an array given that the attribute
|
|
329
|
+
# is documented as an array but the input is not
|
|
330
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
331
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
332
|
+
end
|
|
333
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
334
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
335
|
+
end
|
|
336
|
+
end
|
|
337
|
+
new(transformed_hash)
|
|
338
|
+
end
|
|
339
|
+
|
|
340
|
+
# Returns the object in the form of hash
|
|
341
|
+
# @return [Hash] Returns the object in the form of hash
|
|
342
|
+
def to_hash
|
|
343
|
+
hash = {}
|
|
344
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
345
|
+
value = self.send(attr)
|
|
346
|
+
if value.nil?
|
|
347
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
348
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
hash[param] = _to_hash(value)
|
|
352
|
+
end
|
|
353
|
+
hash
|
|
354
|
+
end
|
|
355
|
+
end
|
|
356
|
+
end
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Bandwidth
|
|
3
|
+
|
|
4
|
+
#Bandwidth's Communication APIs
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: letstalk@bandwidth.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.17.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Bandwidth
|
|
17
|
+
class CreateWebRtcConnectionRequest < ApiModelBase
|
|
18
|
+
attr_accessor :type
|
|
19
|
+
|
|
20
|
+
attr_accessor :direction
|
|
21
|
+
|
|
22
|
+
# The URL to send event callbacks to.
|
|
23
|
+
attr_accessor :event_callback_url
|
|
24
|
+
|
|
25
|
+
# The URL to send event fallbacks to.
|
|
26
|
+
attr_accessor :event_fallback_url
|
|
27
|
+
|
|
28
|
+
# A tag for the endpoint.
|
|
29
|
+
attr_accessor :tag
|
|
30
|
+
|
|
31
|
+
attr_accessor :connection_metadata
|
|
32
|
+
|
|
33
|
+
class EnumAttributeValidator
|
|
34
|
+
attr_reader :datatype
|
|
35
|
+
attr_reader :allowable_values
|
|
36
|
+
|
|
37
|
+
def initialize(datatype, allowable_values)
|
|
38
|
+
@allowable_values = allowable_values.map do |value|
|
|
39
|
+
case datatype.to_s
|
|
40
|
+
when /Integer/i
|
|
41
|
+
value.to_i
|
|
42
|
+
when /Float/i
|
|
43
|
+
value.to_f
|
|
44
|
+
else
|
|
45
|
+
value
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def valid?(value)
|
|
51
|
+
!value || allowable_values.include?(value)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
56
|
+
def self.attribute_map
|
|
57
|
+
{
|
|
58
|
+
:'type' => :'type',
|
|
59
|
+
:'direction' => :'direction',
|
|
60
|
+
:'event_callback_url' => :'eventCallbackUrl',
|
|
61
|
+
:'event_fallback_url' => :'eventFallbackUrl',
|
|
62
|
+
:'tag' => :'tag',
|
|
63
|
+
:'connection_metadata' => :'connectionMetadata'
|
|
64
|
+
}
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Returns attribute mapping this model knows about
|
|
68
|
+
def self.acceptable_attribute_map
|
|
69
|
+
attribute_map
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Returns all the JSON keys this model knows about
|
|
73
|
+
def self.acceptable_attributes
|
|
74
|
+
acceptable_attribute_map.values
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Attribute type mapping.
|
|
78
|
+
def self.openapi_types
|
|
79
|
+
{
|
|
80
|
+
:'type' => :'EndpointTypeEnum',
|
|
81
|
+
:'direction' => :'EndpointDirectionEnum',
|
|
82
|
+
:'event_callback_url' => :'String',
|
|
83
|
+
:'event_fallback_url' => :'String',
|
|
84
|
+
:'tag' => :'String',
|
|
85
|
+
:'connection_metadata' => :'Object'
|
|
86
|
+
}
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# List of attributes with nullable: true
|
|
90
|
+
def self.openapi_nullable
|
|
91
|
+
Set.new([
|
|
92
|
+
])
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# List of class defined in allOf (OpenAPI v3)
|
|
96
|
+
def self.openapi_all_of
|
|
97
|
+
[
|
|
98
|
+
:'CreateEndpointRequestBase'
|
|
99
|
+
]
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Initializes the object
|
|
103
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
104
|
+
def initialize(attributes = {})
|
|
105
|
+
if (!attributes.is_a?(Hash))
|
|
106
|
+
fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CreateWebRtcConnectionRequest` initialize method'
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
110
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
111
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
112
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
113
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateWebRtcConnectionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
114
|
+
end
|
|
115
|
+
h[k.to_sym] = v
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if attributes.key?(:'type')
|
|
119
|
+
self.type = attributes[:'type']
|
|
120
|
+
else
|
|
121
|
+
self.type = nil
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'direction')
|
|
125
|
+
self.direction = attributes[:'direction']
|
|
126
|
+
else
|
|
127
|
+
self.direction = nil
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if attributes.key?(:'event_callback_url')
|
|
131
|
+
self.event_callback_url = attributes[:'event_callback_url']
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if attributes.key?(:'event_fallback_url')
|
|
135
|
+
self.event_fallback_url = attributes[:'event_fallback_url']
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if attributes.key?(:'tag')
|
|
139
|
+
self.tag = attributes[:'tag']
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if attributes.key?(:'connection_metadata')
|
|
143
|
+
self.connection_metadata = attributes[:'connection_metadata']
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
148
|
+
# @return Array for valid properties with the reasons
|
|
149
|
+
def list_invalid_properties
|
|
150
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
151
|
+
invalid_properties = Array.new
|
|
152
|
+
if @type.nil?
|
|
153
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if @direction.nil?
|
|
157
|
+
invalid_properties.push('invalid value for "direction", direction cannot be nil.')
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
invalid_properties
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Check to see if the all the properties in the model are valid
|
|
164
|
+
# @return true if the model is valid
|
|
165
|
+
def valid?
|
|
166
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
167
|
+
return false if @type.nil?
|
|
168
|
+
return false if @direction.nil?
|
|
169
|
+
true
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Custom attribute writer method with validation
|
|
173
|
+
# @param [Object] type Value to be assigned
|
|
174
|
+
def type=(type)
|
|
175
|
+
if type.nil?
|
|
176
|
+
fail ArgumentError, 'type cannot be nil'
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
@type = type
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Custom attribute writer method with validation
|
|
183
|
+
# @param [Object] direction Value to be assigned
|
|
184
|
+
def direction=(direction)
|
|
185
|
+
if direction.nil?
|
|
186
|
+
fail ArgumentError, 'direction cannot be nil'
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
@direction = direction
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# Custom attribute writer method with validation
|
|
193
|
+
# @param [Object] tag Value to be assigned
|
|
194
|
+
def tag=(tag)
|
|
195
|
+
if tag.nil?
|
|
196
|
+
fail ArgumentError, 'tag cannot be nil'
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
@tag = tag
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Checks equality by comparing each attribute.
|
|
203
|
+
# @param [Object] Object to be compared
|
|
204
|
+
def ==(o)
|
|
205
|
+
return true if self.equal?(o)
|
|
206
|
+
self.class == o.class &&
|
|
207
|
+
type == o.type &&
|
|
208
|
+
direction == o.direction &&
|
|
209
|
+
event_callback_url == o.event_callback_url &&
|
|
210
|
+
event_fallback_url == o.event_fallback_url &&
|
|
211
|
+
tag == o.tag &&
|
|
212
|
+
connection_metadata == o.connection_metadata
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# @see the `==` method
|
|
216
|
+
# @param [Object] Object to be compared
|
|
217
|
+
def eql?(o)
|
|
218
|
+
self == o
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Calculates hash code according to all attributes.
|
|
222
|
+
# @return [Integer] Hash code
|
|
223
|
+
def hash
|
|
224
|
+
[type, direction, event_callback_url, event_fallback_url, tag, connection_metadata].hash
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Builds the object from hash
|
|
228
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
229
|
+
# @return [Object] Returns the model itself
|
|
230
|
+
def self.build_from_hash(attributes)
|
|
231
|
+
return nil unless attributes.is_a?(Hash)
|
|
232
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
233
|
+
transformed_hash = {}
|
|
234
|
+
openapi_types.each_pair do |key, type|
|
|
235
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
236
|
+
transformed_hash["#{key}"] = nil
|
|
237
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
238
|
+
# check to ensure the input is an array given that the attribute
|
|
239
|
+
# is documented as an array but the input is not
|
|
240
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
241
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
242
|
+
end
|
|
243
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
244
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
new(transformed_hash)
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# Returns the object in the form of hash
|
|
251
|
+
# @return [Hash] Returns the object in the form of hash
|
|
252
|
+
def to_hash
|
|
253
|
+
hash = {}
|
|
254
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
255
|
+
value = self.send(attr)
|
|
256
|
+
if value.nil?
|
|
257
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
258
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
hash[param] = _to_hash(value)
|
|
262
|
+
end
|
|
263
|
+
hash
|
|
264
|
+
end
|
|
265
|
+
end
|
|
266
|
+
end
|