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,258 @@
|
|
|
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 Device < ApiModelBase
|
|
18
|
+
# The unique ID of the device.
|
|
19
|
+
attr_accessor :device_id
|
|
20
|
+
|
|
21
|
+
# The name of the device.
|
|
22
|
+
attr_accessor :device_name
|
|
23
|
+
|
|
24
|
+
attr_accessor :status
|
|
25
|
+
|
|
26
|
+
# The time the device was created. In ISO-8601 format.
|
|
27
|
+
attr_accessor :creation_timestamp
|
|
28
|
+
|
|
29
|
+
class EnumAttributeValidator
|
|
30
|
+
attr_reader :datatype
|
|
31
|
+
attr_reader :allowable_values
|
|
32
|
+
|
|
33
|
+
def initialize(datatype, allowable_values)
|
|
34
|
+
@allowable_values = allowable_values.map do |value|
|
|
35
|
+
case datatype.to_s
|
|
36
|
+
when /Integer/i
|
|
37
|
+
value.to_i
|
|
38
|
+
when /Float/i
|
|
39
|
+
value.to_f
|
|
40
|
+
else
|
|
41
|
+
value
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def valid?(value)
|
|
47
|
+
!value || allowable_values.include?(value)
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
52
|
+
def self.attribute_map
|
|
53
|
+
{
|
|
54
|
+
:'device_id' => :'deviceId',
|
|
55
|
+
:'device_name' => :'deviceName',
|
|
56
|
+
:'status' => :'status',
|
|
57
|
+
:'creation_timestamp' => :'creationTimestamp'
|
|
58
|
+
}
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Returns attribute mapping this model knows about
|
|
62
|
+
def self.acceptable_attribute_map
|
|
63
|
+
attribute_map
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Returns all the JSON keys this model knows about
|
|
67
|
+
def self.acceptable_attributes
|
|
68
|
+
acceptable_attribute_map.values
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Attribute type mapping.
|
|
72
|
+
def self.openapi_types
|
|
73
|
+
{
|
|
74
|
+
:'device_id' => :'String',
|
|
75
|
+
:'device_name' => :'String',
|
|
76
|
+
:'status' => :'DeviceStatusEnum',
|
|
77
|
+
:'creation_timestamp' => :'Time'
|
|
78
|
+
}
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# List of attributes with nullable: true
|
|
82
|
+
def self.openapi_nullable
|
|
83
|
+
Set.new([
|
|
84
|
+
])
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Initializes the object
|
|
88
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
89
|
+
def initialize(attributes = {})
|
|
90
|
+
if (!attributes.is_a?(Hash))
|
|
91
|
+
fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::Device` initialize method'
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
95
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
96
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
97
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
98
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Device`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
99
|
+
end
|
|
100
|
+
h[k.to_sym] = v
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if attributes.key?(:'device_id')
|
|
104
|
+
self.device_id = attributes[:'device_id']
|
|
105
|
+
else
|
|
106
|
+
self.device_id = nil
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
if attributes.key?(:'device_name')
|
|
110
|
+
self.device_name = attributes[:'device_name']
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if attributes.key?(:'status')
|
|
114
|
+
self.status = attributes[:'status']
|
|
115
|
+
else
|
|
116
|
+
self.status = nil
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if attributes.key?(:'creation_timestamp')
|
|
120
|
+
self.creation_timestamp = attributes[:'creation_timestamp']
|
|
121
|
+
else
|
|
122
|
+
self.creation_timestamp = nil
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
127
|
+
# @return Array for valid properties with the reasons
|
|
128
|
+
def list_invalid_properties
|
|
129
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
130
|
+
invalid_properties = Array.new
|
|
131
|
+
if @device_id.nil?
|
|
132
|
+
invalid_properties.push('invalid value for "device_id", device_id cannot be nil.')
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
if @status.nil?
|
|
136
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
if @creation_timestamp.nil?
|
|
140
|
+
invalid_properties.push('invalid value for "creation_timestamp", creation_timestamp cannot be nil.')
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
invalid_properties
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Check to see if the all the properties in the model are valid
|
|
147
|
+
# @return true if the model is valid
|
|
148
|
+
def valid?
|
|
149
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
150
|
+
return false if @device_id.nil?
|
|
151
|
+
return false if @status.nil?
|
|
152
|
+
return false if @creation_timestamp.nil?
|
|
153
|
+
true
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Custom attribute writer method with validation
|
|
157
|
+
# @param [Object] device_id Value to be assigned
|
|
158
|
+
def device_id=(device_id)
|
|
159
|
+
if device_id.nil?
|
|
160
|
+
fail ArgumentError, 'device_id cannot be nil'
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
@device_id = device_id
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Custom attribute writer method with validation
|
|
167
|
+
# @param [Object] device_name Value to be assigned
|
|
168
|
+
def device_name=(device_name)
|
|
169
|
+
if device_name.nil?
|
|
170
|
+
fail ArgumentError, 'device_name cannot be nil'
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
@device_name = device_name
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# Custom attribute writer method with validation
|
|
177
|
+
# @param [Object] status Value to be assigned
|
|
178
|
+
def status=(status)
|
|
179
|
+
if status.nil?
|
|
180
|
+
fail ArgumentError, 'status cannot be nil'
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
@status = status
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Custom attribute writer method with validation
|
|
187
|
+
# @param [Object] creation_timestamp Value to be assigned
|
|
188
|
+
def creation_timestamp=(creation_timestamp)
|
|
189
|
+
if creation_timestamp.nil?
|
|
190
|
+
fail ArgumentError, 'creation_timestamp cannot be nil'
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
@creation_timestamp = creation_timestamp
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# Checks equality by comparing each attribute.
|
|
197
|
+
# @param [Object] Object to be compared
|
|
198
|
+
def ==(o)
|
|
199
|
+
return true if self.equal?(o)
|
|
200
|
+
self.class == o.class &&
|
|
201
|
+
device_id == o.device_id &&
|
|
202
|
+
device_name == o.device_name &&
|
|
203
|
+
status == o.status &&
|
|
204
|
+
creation_timestamp == o.creation_timestamp
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# @see the `==` method
|
|
208
|
+
# @param [Object] Object to be compared
|
|
209
|
+
def eql?(o)
|
|
210
|
+
self == o
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
# Calculates hash code according to all attributes.
|
|
214
|
+
# @return [Integer] Hash code
|
|
215
|
+
def hash
|
|
216
|
+
[device_id, device_name, status, creation_timestamp].hash
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# Builds the object from hash
|
|
220
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
221
|
+
# @return [Object] Returns the model itself
|
|
222
|
+
def self.build_from_hash(attributes)
|
|
223
|
+
return nil unless attributes.is_a?(Hash)
|
|
224
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
225
|
+
transformed_hash = {}
|
|
226
|
+
openapi_types.each_pair do |key, type|
|
|
227
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
228
|
+
transformed_hash["#{key}"] = nil
|
|
229
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
230
|
+
# check to ensure the input is an array given that the attribute
|
|
231
|
+
# is documented as an array but the input is not
|
|
232
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
233
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
234
|
+
end
|
|
235
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
236
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
237
|
+
end
|
|
238
|
+
end
|
|
239
|
+
new(transformed_hash)
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
# Returns the object in the form of hash
|
|
243
|
+
# @return [Hash] Returns the object in the form of hash
|
|
244
|
+
def to_hash
|
|
245
|
+
hash = {}
|
|
246
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
247
|
+
value = self.send(attr)
|
|
248
|
+
if value.nil?
|
|
249
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
250
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
hash[param] = _to_hash(value)
|
|
254
|
+
end
|
|
255
|
+
hash
|
|
256
|
+
end
|
|
257
|
+
end
|
|
258
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
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 DeviceStatusEnum
|
|
18
|
+
CONNECTED = 'CONNECTED'.freeze
|
|
19
|
+
DISCONNECTED = 'DISCONNECTED'.freeze
|
|
20
|
+
|
|
21
|
+
def self.all_vars
|
|
22
|
+
@all_vars ||= [CONNECTED, DISCONNECTED].freeze
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Builds the enum from string
|
|
26
|
+
# @param [String] The enum value in the form of the string
|
|
27
|
+
# @return [String] The enum value
|
|
28
|
+
def self.build_from_hash(value)
|
|
29
|
+
new.build_from_hash(value)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Builds the enum from string
|
|
33
|
+
# @param [String] The enum value in the form of the string
|
|
34
|
+
# @return [String] The enum value
|
|
35
|
+
def build_from_hash(value)
|
|
36
|
+
return value if DeviceStatusEnum.all_vars.include?(value)
|
|
37
|
+
raise "Invalid ENUM value #{value} for class #DeviceStatusEnum"
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,329 @@
|
|
|
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 Endpoint < 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
|
+
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
|
+
:'endpoint_id' => :'endpointId',
|
|
62
|
+
:'type' => :'type',
|
|
63
|
+
:'status' => :'status',
|
|
64
|
+
:'creation_timestamp' => :'creationTimestamp',
|
|
65
|
+
:'expiration_timestamp' => :'expirationTimestamp',
|
|
66
|
+
:'tag' => :'tag',
|
|
67
|
+
:'devices' => :'devices'
|
|
68
|
+
}
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Returns attribute mapping this model knows about
|
|
72
|
+
def self.acceptable_attribute_map
|
|
73
|
+
attribute_map
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Returns all the JSON keys this model knows about
|
|
77
|
+
def self.acceptable_attributes
|
|
78
|
+
acceptable_attribute_map.values
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Attribute type mapping.
|
|
82
|
+
def self.openapi_types
|
|
83
|
+
{
|
|
84
|
+
:'endpoint_id' => :'String',
|
|
85
|
+
:'type' => :'EndpointTypeEnum',
|
|
86
|
+
:'status' => :'EndpointStatusEnum',
|
|
87
|
+
:'creation_timestamp' => :'Time',
|
|
88
|
+
:'expiration_timestamp' => :'Time',
|
|
89
|
+
:'tag' => :'String',
|
|
90
|
+
:'devices' => :'Array<Device>'
|
|
91
|
+
}
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# List of attributes with nullable: true
|
|
95
|
+
def self.openapi_nullable
|
|
96
|
+
Set.new([
|
|
97
|
+
])
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# List of class defined in allOf (OpenAPI v3)
|
|
101
|
+
def self.openapi_all_of
|
|
102
|
+
[
|
|
103
|
+
:'Endpoints'
|
|
104
|
+
]
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Initializes the object
|
|
108
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
109
|
+
def initialize(attributes = {})
|
|
110
|
+
if (!attributes.is_a?(Hash))
|
|
111
|
+
fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::Endpoint` initialize method'
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
115
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
116
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
117
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
118
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Endpoint`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
119
|
+
end
|
|
120
|
+
h[k.to_sym] = v
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if attributes.key?(:'endpoint_id')
|
|
124
|
+
self.endpoint_id = attributes[:'endpoint_id']
|
|
125
|
+
else
|
|
126
|
+
self.endpoint_id = nil
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
if attributes.key?(:'type')
|
|
130
|
+
self.type = attributes[:'type']
|
|
131
|
+
else
|
|
132
|
+
self.type = nil
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
if attributes.key?(:'status')
|
|
136
|
+
self.status = attributes[:'status']
|
|
137
|
+
else
|
|
138
|
+
self.status = nil
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
if attributes.key?(:'creation_timestamp')
|
|
142
|
+
self.creation_timestamp = attributes[:'creation_timestamp']
|
|
143
|
+
else
|
|
144
|
+
self.creation_timestamp = nil
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if attributes.key?(:'expiration_timestamp')
|
|
148
|
+
self.expiration_timestamp = attributes[:'expiration_timestamp']
|
|
149
|
+
else
|
|
150
|
+
self.expiration_timestamp = nil
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
if attributes.key?(:'tag')
|
|
154
|
+
self.tag = attributes[:'tag']
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
if attributes.key?(:'devices')
|
|
158
|
+
if (value = attributes[:'devices']).is_a?(Array)
|
|
159
|
+
self.devices = value
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
165
|
+
# @return Array for valid properties with the reasons
|
|
166
|
+
def list_invalid_properties
|
|
167
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
168
|
+
invalid_properties = Array.new
|
|
169
|
+
if @endpoint_id.nil?
|
|
170
|
+
invalid_properties.push('invalid value for "endpoint_id", endpoint_id cannot be nil.')
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
if @type.nil?
|
|
174
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
if @status.nil?
|
|
178
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
if @creation_timestamp.nil?
|
|
182
|
+
invalid_properties.push('invalid value for "creation_timestamp", creation_timestamp cannot be nil.')
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
if @expiration_timestamp.nil?
|
|
186
|
+
invalid_properties.push('invalid value for "expiration_timestamp", expiration_timestamp cannot be nil.')
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
invalid_properties
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# Check to see if the all the properties in the model are valid
|
|
193
|
+
# @return true if the model is valid
|
|
194
|
+
def valid?
|
|
195
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
196
|
+
return false if @endpoint_id.nil?
|
|
197
|
+
return false if @type.nil?
|
|
198
|
+
return false if @status.nil?
|
|
199
|
+
return false if @creation_timestamp.nil?
|
|
200
|
+
return false if @expiration_timestamp.nil?
|
|
201
|
+
true
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Custom attribute writer method with validation
|
|
205
|
+
# @param [Object] endpoint_id Value to be assigned
|
|
206
|
+
def endpoint_id=(endpoint_id)
|
|
207
|
+
if endpoint_id.nil?
|
|
208
|
+
fail ArgumentError, 'endpoint_id cannot be nil'
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
@endpoint_id = endpoint_id
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# Custom attribute writer method with validation
|
|
215
|
+
# @param [Object] type Value to be assigned
|
|
216
|
+
def type=(type)
|
|
217
|
+
if type.nil?
|
|
218
|
+
fail ArgumentError, 'type cannot be nil'
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
@type = type
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
# Custom attribute writer method with validation
|
|
225
|
+
# @param [Object] status Value to be assigned
|
|
226
|
+
def status=(status)
|
|
227
|
+
if status.nil?
|
|
228
|
+
fail ArgumentError, 'status cannot be nil'
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
@status = status
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
# Custom attribute writer method with validation
|
|
235
|
+
# @param [Object] creation_timestamp Value to be assigned
|
|
236
|
+
def creation_timestamp=(creation_timestamp)
|
|
237
|
+
if creation_timestamp.nil?
|
|
238
|
+
fail ArgumentError, 'creation_timestamp cannot be nil'
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
@creation_timestamp = creation_timestamp
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
# Custom attribute writer method with validation
|
|
245
|
+
# @param [Object] expiration_timestamp Value to be assigned
|
|
246
|
+
def expiration_timestamp=(expiration_timestamp)
|
|
247
|
+
if expiration_timestamp.nil?
|
|
248
|
+
fail ArgumentError, 'expiration_timestamp cannot be nil'
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
@expiration_timestamp = expiration_timestamp
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
# Custom attribute writer method with validation
|
|
255
|
+
# @param [Object] tag Value to be assigned
|
|
256
|
+
def tag=(tag)
|
|
257
|
+
if tag.nil?
|
|
258
|
+
fail ArgumentError, 'tag cannot be nil'
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
@tag = tag
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
# Checks equality by comparing each attribute.
|
|
265
|
+
# @param [Object] Object to be compared
|
|
266
|
+
def ==(o)
|
|
267
|
+
return true if self.equal?(o)
|
|
268
|
+
self.class == o.class &&
|
|
269
|
+
endpoint_id == o.endpoint_id &&
|
|
270
|
+
type == o.type &&
|
|
271
|
+
status == o.status &&
|
|
272
|
+
creation_timestamp == o.creation_timestamp &&
|
|
273
|
+
expiration_timestamp == o.expiration_timestamp &&
|
|
274
|
+
tag == o.tag &&
|
|
275
|
+
devices == o.devices
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
# @see the `==` method
|
|
279
|
+
# @param [Object] Object to be compared
|
|
280
|
+
def eql?(o)
|
|
281
|
+
self == o
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
# Calculates hash code according to all attributes.
|
|
285
|
+
# @return [Integer] Hash code
|
|
286
|
+
def hash
|
|
287
|
+
[endpoint_id, type, status, creation_timestamp, expiration_timestamp, tag, devices].hash
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
# Builds the object from hash
|
|
291
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
292
|
+
# @return [Object] Returns the model itself
|
|
293
|
+
def self.build_from_hash(attributes)
|
|
294
|
+
return nil unless attributes.is_a?(Hash)
|
|
295
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
296
|
+
transformed_hash = {}
|
|
297
|
+
openapi_types.each_pair do |key, type|
|
|
298
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
299
|
+
transformed_hash["#{key}"] = nil
|
|
300
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
301
|
+
# check to ensure the input is an array given that the attribute
|
|
302
|
+
# is documented as an array but the input is not
|
|
303
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
304
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
305
|
+
end
|
|
306
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
307
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
308
|
+
end
|
|
309
|
+
end
|
|
310
|
+
new(transformed_hash)
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
# Returns the object in the form of hash
|
|
314
|
+
# @return [Hash] Returns the object in the form of hash
|
|
315
|
+
def to_hash
|
|
316
|
+
hash = {}
|
|
317
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
318
|
+
value = self.send(attr)
|
|
319
|
+
if value.nil?
|
|
320
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
321
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
hash[param] = _to_hash(value)
|
|
325
|
+
end
|
|
326
|
+
hash
|
|
327
|
+
end
|
|
328
|
+
end
|
|
329
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
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 EndpointDirectionEnum
|
|
18
|
+
INBOUND = 'INBOUND'.freeze
|
|
19
|
+
OUTBOUND = 'OUTBOUND'.freeze
|
|
20
|
+
BIDIRECTIONAL = 'BIDIRECTIONAL'.freeze
|
|
21
|
+
|
|
22
|
+
def self.all_vars
|
|
23
|
+
@all_vars ||= [INBOUND, OUTBOUND, BIDIRECTIONAL].freeze
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Builds the enum from string
|
|
27
|
+
# @param [String] The enum value in the form of the string
|
|
28
|
+
# @return [String] The enum value
|
|
29
|
+
def self.build_from_hash(value)
|
|
30
|
+
new.build_from_hash(value)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Builds the enum from string
|
|
34
|
+
# @param [String] The enum value in the form of the string
|
|
35
|
+
# @return [String] The enum value
|
|
36
|
+
def build_from_hash(value)
|
|
37
|
+
return value if EndpointDirectionEnum.all_vars.include?(value)
|
|
38
|
+
raise "Invalid ENUM value #{value} for class #EndpointDirectionEnum"
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|