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,259 @@
|
|
|
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 Page < ApiModelBase
|
|
18
|
+
# The number of items per page.
|
|
19
|
+
attr_accessor :page_size
|
|
20
|
+
|
|
21
|
+
# The total number of items.
|
|
22
|
+
attr_accessor :total_elements
|
|
23
|
+
|
|
24
|
+
# The total number of pages.
|
|
25
|
+
attr_accessor :total_pages
|
|
26
|
+
|
|
27
|
+
# The current page number.
|
|
28
|
+
attr_accessor :page_number
|
|
29
|
+
|
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
31
|
+
def self.attribute_map
|
|
32
|
+
{
|
|
33
|
+
:'page_size' => :'pageSize',
|
|
34
|
+
:'total_elements' => :'totalElements',
|
|
35
|
+
:'total_pages' => :'totalPages',
|
|
36
|
+
:'page_number' => :'pageNumber'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Returns attribute mapping this model knows about
|
|
41
|
+
def self.acceptable_attribute_map
|
|
42
|
+
attribute_map
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Returns all the JSON keys this model knows about
|
|
46
|
+
def self.acceptable_attributes
|
|
47
|
+
acceptable_attribute_map.values
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Attribute type mapping.
|
|
51
|
+
def self.openapi_types
|
|
52
|
+
{
|
|
53
|
+
:'page_size' => :'Integer',
|
|
54
|
+
:'total_elements' => :'Integer',
|
|
55
|
+
:'total_pages' => :'Integer',
|
|
56
|
+
:'page_number' => :'Integer'
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# List of attributes with nullable: true
|
|
61
|
+
def self.openapi_nullable
|
|
62
|
+
Set.new([
|
|
63
|
+
])
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Initializes the object
|
|
67
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
68
|
+
def initialize(attributes = {})
|
|
69
|
+
if (!attributes.is_a?(Hash))
|
|
70
|
+
fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::Page` initialize method'
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
74
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
75
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
76
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
77
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Page`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
78
|
+
end
|
|
79
|
+
h[k.to_sym] = v
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if attributes.key?(:'page_size')
|
|
83
|
+
self.page_size = attributes[:'page_size']
|
|
84
|
+
else
|
|
85
|
+
self.page_size = nil
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'total_elements')
|
|
89
|
+
self.total_elements = attributes[:'total_elements']
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'total_pages')
|
|
93
|
+
self.total_pages = attributes[:'total_pages']
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
if attributes.key?(:'page_number')
|
|
97
|
+
self.page_number = attributes[:'page_number']
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
102
|
+
# @return Array for valid properties with the reasons
|
|
103
|
+
def list_invalid_properties
|
|
104
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
105
|
+
invalid_properties = Array.new
|
|
106
|
+
if @page_size.nil?
|
|
107
|
+
invalid_properties.push('invalid value for "page_size", page_size cannot be nil.')
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if @page_size < 0
|
|
111
|
+
invalid_properties.push('invalid value for "page_size", must be greater than or equal to 0.')
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if !@total_elements.nil? && @total_elements < 0
|
|
115
|
+
invalid_properties.push('invalid value for "total_elements", must be greater than or equal to 0.')
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if !@total_pages.nil? && @total_pages < 0
|
|
119
|
+
invalid_properties.push('invalid value for "total_pages", must be greater than or equal to 0.')
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
if !@page_number.nil? && @page_number < 0
|
|
123
|
+
invalid_properties.push('invalid value for "page_number", must be greater than or equal to 0.')
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
invalid_properties
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Check to see if the all the properties in the model are valid
|
|
130
|
+
# @return true if the model is valid
|
|
131
|
+
def valid?
|
|
132
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
133
|
+
return false if @page_size.nil?
|
|
134
|
+
return false if @page_size < 0
|
|
135
|
+
return false if !@total_elements.nil? && @total_elements < 0
|
|
136
|
+
return false if !@total_pages.nil? && @total_pages < 0
|
|
137
|
+
return false if !@page_number.nil? && @page_number < 0
|
|
138
|
+
true
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Custom attribute writer method with validation
|
|
142
|
+
# @param [Object] page_size Value to be assigned
|
|
143
|
+
def page_size=(page_size)
|
|
144
|
+
if page_size.nil?
|
|
145
|
+
fail ArgumentError, 'page_size cannot be nil'
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if page_size < 0
|
|
149
|
+
fail ArgumentError, 'invalid value for "page_size", must be greater than or equal to 0.'
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
@page_size = page_size
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Custom attribute writer method with validation
|
|
156
|
+
# @param [Object] total_elements Value to be assigned
|
|
157
|
+
def total_elements=(total_elements)
|
|
158
|
+
if total_elements.nil?
|
|
159
|
+
fail ArgumentError, 'total_elements cannot be nil'
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
if total_elements < 0
|
|
163
|
+
fail ArgumentError, 'invalid value for "total_elements", must be greater than or equal to 0.'
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
@total_elements = total_elements
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Custom attribute writer method with validation
|
|
170
|
+
# @param [Object] total_pages Value to be assigned
|
|
171
|
+
def total_pages=(total_pages)
|
|
172
|
+
if total_pages.nil?
|
|
173
|
+
fail ArgumentError, 'total_pages cannot be nil'
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
if total_pages < 0
|
|
177
|
+
fail ArgumentError, 'invalid value for "total_pages", must be greater than or equal to 0.'
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
@total_pages = total_pages
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Custom attribute writer method with validation
|
|
184
|
+
# @param [Object] page_number Value to be assigned
|
|
185
|
+
def page_number=(page_number)
|
|
186
|
+
if page_number.nil?
|
|
187
|
+
fail ArgumentError, 'page_number cannot be nil'
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
if page_number < 0
|
|
191
|
+
fail ArgumentError, 'invalid value for "page_number", must be greater than or equal to 0.'
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
@page_number = page_number
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Checks equality by comparing each attribute.
|
|
198
|
+
# @param [Object] Object to be compared
|
|
199
|
+
def ==(o)
|
|
200
|
+
return true if self.equal?(o)
|
|
201
|
+
self.class == o.class &&
|
|
202
|
+
page_size == o.page_size &&
|
|
203
|
+
total_elements == o.total_elements &&
|
|
204
|
+
total_pages == o.total_pages &&
|
|
205
|
+
page_number == o.page_number
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# @see the `==` method
|
|
209
|
+
# @param [Object] Object to be compared
|
|
210
|
+
def eql?(o)
|
|
211
|
+
self == o
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# Calculates hash code according to all attributes.
|
|
215
|
+
# @return [Integer] Hash code
|
|
216
|
+
def hash
|
|
217
|
+
[page_size, total_elements, total_pages, page_number].hash
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# Builds the object from hash
|
|
221
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
222
|
+
# @return [Object] Returns the model itself
|
|
223
|
+
def self.build_from_hash(attributes)
|
|
224
|
+
return nil unless attributes.is_a?(Hash)
|
|
225
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
226
|
+
transformed_hash = {}
|
|
227
|
+
openapi_types.each_pair do |key, type|
|
|
228
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
229
|
+
transformed_hash["#{key}"] = nil
|
|
230
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
231
|
+
# check to ensure the input is an array given that the attribute
|
|
232
|
+
# is documented as an array but the input is not
|
|
233
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
234
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
235
|
+
end
|
|
236
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
237
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
238
|
+
end
|
|
239
|
+
end
|
|
240
|
+
new(transformed_hash)
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
# Returns the object in the form of hash
|
|
244
|
+
# @return [Hash] Returns the object in the form of hash
|
|
245
|
+
def to_hash
|
|
246
|
+
hash = {}
|
|
247
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
248
|
+
value = self.send(attr)
|
|
249
|
+
if value.nil?
|
|
250
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
251
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
hash[param] = _to_hash(value)
|
|
255
|
+
end
|
|
256
|
+
hash
|
|
257
|
+
end
|
|
258
|
+
end
|
|
259
|
+
end
|
|
@@ -0,0 +1,175 @@
|
|
|
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 SipConnectionMetadata < ApiModelBase
|
|
18
|
+
# The IP address of the SIP connection.
|
|
19
|
+
attr_accessor :ip_address
|
|
20
|
+
|
|
21
|
+
# The port of the SIP connection.
|
|
22
|
+
attr_accessor :port
|
|
23
|
+
|
|
24
|
+
attr_accessor :credentials
|
|
25
|
+
|
|
26
|
+
# The User-to-User Information header for the SIP connection.
|
|
27
|
+
attr_accessor :uui_header
|
|
28
|
+
|
|
29
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
30
|
+
def self.attribute_map
|
|
31
|
+
{
|
|
32
|
+
:'ip_address' => :'ipAddress',
|
|
33
|
+
:'port' => :'port',
|
|
34
|
+
:'credentials' => :'credentials',
|
|
35
|
+
:'uui_header' => :'uuiHeader'
|
|
36
|
+
}
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Returns attribute mapping this model knows about
|
|
40
|
+
def self.acceptable_attribute_map
|
|
41
|
+
attribute_map
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Returns all the JSON keys this model knows about
|
|
45
|
+
def self.acceptable_attributes
|
|
46
|
+
acceptable_attribute_map.values
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Attribute type mapping.
|
|
50
|
+
def self.openapi_types
|
|
51
|
+
{
|
|
52
|
+
:'ip_address' => :'String',
|
|
53
|
+
:'port' => :'Integer',
|
|
54
|
+
:'credentials' => :'SipCredentials',
|
|
55
|
+
:'uui_header' => :'String'
|
|
56
|
+
}
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# List of attributes with nullable: true
|
|
60
|
+
def self.openapi_nullable
|
|
61
|
+
Set.new([
|
|
62
|
+
])
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Initializes the object
|
|
66
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
67
|
+
def initialize(attributes = {})
|
|
68
|
+
if (!attributes.is_a?(Hash))
|
|
69
|
+
fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::SipConnectionMetadata` initialize method'
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
73
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
74
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
75
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
76
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::SipConnectionMetadata`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
77
|
+
end
|
|
78
|
+
h[k.to_sym] = v
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if attributes.key?(:'ip_address')
|
|
82
|
+
self.ip_address = attributes[:'ip_address']
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
if attributes.key?(:'port')
|
|
86
|
+
self.port = attributes[:'port']
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
if attributes.key?(:'credentials')
|
|
90
|
+
self.credentials = attributes[:'credentials']
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
if attributes.key?(:'uui_header')
|
|
94
|
+
self.uui_header = attributes[:'uui_header']
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
99
|
+
# @return Array for valid properties with the reasons
|
|
100
|
+
def list_invalid_properties
|
|
101
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
102
|
+
invalid_properties = Array.new
|
|
103
|
+
invalid_properties
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Check to see if the all the properties in the model are valid
|
|
107
|
+
# @return true if the model is valid
|
|
108
|
+
def valid?
|
|
109
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
110
|
+
true
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Checks equality by comparing each attribute.
|
|
114
|
+
# @param [Object] Object to be compared
|
|
115
|
+
def ==(o)
|
|
116
|
+
return true if self.equal?(o)
|
|
117
|
+
self.class == o.class &&
|
|
118
|
+
ip_address == o.ip_address &&
|
|
119
|
+
port == o.port &&
|
|
120
|
+
credentials == o.credentials &&
|
|
121
|
+
uui_header == o.uui_header
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# @see the `==` method
|
|
125
|
+
# @param [Object] Object to be compared
|
|
126
|
+
def eql?(o)
|
|
127
|
+
self == o
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Calculates hash code according to all attributes.
|
|
131
|
+
# @return [Integer] Hash code
|
|
132
|
+
def hash
|
|
133
|
+
[ip_address, port, credentials, uui_header].hash
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Builds the object from hash
|
|
137
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
138
|
+
# @return [Object] Returns the model itself
|
|
139
|
+
def self.build_from_hash(attributes)
|
|
140
|
+
return nil unless attributes.is_a?(Hash)
|
|
141
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
142
|
+
transformed_hash = {}
|
|
143
|
+
openapi_types.each_pair do |key, type|
|
|
144
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
145
|
+
transformed_hash["#{key}"] = nil
|
|
146
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
147
|
+
# check to ensure the input is an array given that the attribute
|
|
148
|
+
# is documented as an array but the input is not
|
|
149
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
150
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
151
|
+
end
|
|
152
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
153
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
new(transformed_hash)
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Returns the object in the form of hash
|
|
160
|
+
# @return [Hash] Returns the object in the form of hash
|
|
161
|
+
def to_hash
|
|
162
|
+
hash = {}
|
|
163
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
164
|
+
value = self.send(attr)
|
|
165
|
+
if value.nil?
|
|
166
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
167
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
hash[param] = _to_hash(value)
|
|
171
|
+
end
|
|
172
|
+
hash
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
end
|
|
@@ -0,0 +1,156 @@
|
|
|
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 SipCredentials < ApiModelBase
|
|
18
|
+
# The username for the SIP connection.
|
|
19
|
+
attr_accessor :username
|
|
20
|
+
|
|
21
|
+
# The password for the SIP connection.
|
|
22
|
+
attr_accessor :password
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'username' => :'username',
|
|
28
|
+
:'password' => :'password'
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns attribute mapping this model knows about
|
|
33
|
+
def self.acceptable_attribute_map
|
|
34
|
+
attribute_map
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns all the JSON keys this model knows about
|
|
38
|
+
def self.acceptable_attributes
|
|
39
|
+
acceptable_attribute_map.values
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Attribute type mapping.
|
|
43
|
+
def self.openapi_types
|
|
44
|
+
{
|
|
45
|
+
:'username' => :'String',
|
|
46
|
+
:'password' => :'String'
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# List of attributes with nullable: true
|
|
51
|
+
def self.openapi_nullable
|
|
52
|
+
Set.new([
|
|
53
|
+
])
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Initializes the object
|
|
57
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
58
|
+
def initialize(attributes = {})
|
|
59
|
+
if (!attributes.is_a?(Hash))
|
|
60
|
+
fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::SipCredentials` initialize method'
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
64
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
66
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::SipCredentials`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
68
|
+
end
|
|
69
|
+
h[k.to_sym] = v
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if attributes.key?(:'username')
|
|
73
|
+
self.username = attributes[:'username']
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
if attributes.key?(:'password')
|
|
77
|
+
self.password = attributes[:'password']
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
82
|
+
# @return Array for valid properties with the reasons
|
|
83
|
+
def list_invalid_properties
|
|
84
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
85
|
+
invalid_properties = Array.new
|
|
86
|
+
invalid_properties
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Check to see if the all the properties in the model are valid
|
|
90
|
+
# @return true if the model is valid
|
|
91
|
+
def valid?
|
|
92
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
93
|
+
true
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Checks equality by comparing each attribute.
|
|
97
|
+
# @param [Object] Object to be compared
|
|
98
|
+
def ==(o)
|
|
99
|
+
return true if self.equal?(o)
|
|
100
|
+
self.class == o.class &&
|
|
101
|
+
username == o.username &&
|
|
102
|
+
password == o.password
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# @see the `==` method
|
|
106
|
+
# @param [Object] Object to be compared
|
|
107
|
+
def eql?(o)
|
|
108
|
+
self == o
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Calculates hash code according to all attributes.
|
|
112
|
+
# @return [Integer] Hash code
|
|
113
|
+
def hash
|
|
114
|
+
[username, password].hash
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Builds the object from hash
|
|
118
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
119
|
+
# @return [Object] Returns the model itself
|
|
120
|
+
def self.build_from_hash(attributes)
|
|
121
|
+
return nil unless attributes.is_a?(Hash)
|
|
122
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
123
|
+
transformed_hash = {}
|
|
124
|
+
openapi_types.each_pair do |key, type|
|
|
125
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
126
|
+
transformed_hash["#{key}"] = nil
|
|
127
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
128
|
+
# check to ensure the input is an array given that the attribute
|
|
129
|
+
# is documented as an array but the input is not
|
|
130
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
131
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
132
|
+
end
|
|
133
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
134
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
new(transformed_hash)
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Returns the object in the form of hash
|
|
141
|
+
# @return [Hash] Returns the object in the form of hash
|
|
142
|
+
def to_hash
|
|
143
|
+
hash = {}
|
|
144
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
145
|
+
value = self.send(attr)
|
|
146
|
+
if value.nil?
|
|
147
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
148
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
hash[param] = _to_hash(value)
|
|
152
|
+
end
|
|
153
|
+
hash
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
end
|
|
@@ -34,7 +34,7 @@ module Bandwidth
|
|
|
34
34
|
# Optional error code, applicable only when type is `message-failed`.
|
|
35
35
|
attr_accessor :error_code
|
|
36
36
|
|
|
37
|
-
# The name of the Authorized Message Provider (AMP) that handled this message.
|
|
37
|
+
# The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled.
|
|
38
38
|
attr_accessor :carrier_name
|
|
39
39
|
|
|
40
40
|
class EnumAttributeValidator
|
|
@@ -18,10 +18,14 @@ module Bandwidth
|
|
|
18
18
|
# Telephone numbers in E.164 format.
|
|
19
19
|
attr_accessor :phone_numbers
|
|
20
20
|
|
|
21
|
+
# Override the default RCS sender/agent ID used when checking RCS capabilities. When provided, this value is used as the `sender` in the RCS capability-check request instead of the account default. Must be 1–40 characters and contain only letters, digits, underscores, or hyphens.
|
|
22
|
+
attr_accessor :rcs_agent
|
|
23
|
+
|
|
21
24
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
25
|
def self.attribute_map
|
|
23
26
|
{
|
|
24
|
-
:'phone_numbers' => :'phoneNumbers'
|
|
27
|
+
:'phone_numbers' => :'phoneNumbers',
|
|
28
|
+
:'rcs_agent' => :'rcsAgent'
|
|
25
29
|
}
|
|
26
30
|
end
|
|
27
31
|
|
|
@@ -38,7 +42,8 @@ module Bandwidth
|
|
|
38
42
|
# Attribute type mapping.
|
|
39
43
|
def self.openapi_types
|
|
40
44
|
{
|
|
41
|
-
:'phone_numbers' => :'Array<String>'
|
|
45
|
+
:'phone_numbers' => :'Array<String>',
|
|
46
|
+
:'rcs_agent' => :'String'
|
|
42
47
|
}
|
|
43
48
|
end
|
|
44
49
|
|
|
@@ -71,6 +76,10 @@ module Bandwidth
|
|
|
71
76
|
else
|
|
72
77
|
self.phone_numbers = nil
|
|
73
78
|
end
|
|
79
|
+
|
|
80
|
+
if attributes.key?(:'rcs_agent')
|
|
81
|
+
self.rcs_agent = attributes[:'rcs_agent']
|
|
82
|
+
end
|
|
74
83
|
end
|
|
75
84
|
|
|
76
85
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -82,6 +91,11 @@ module Bandwidth
|
|
|
82
91
|
invalid_properties.push('invalid value for "phone_numbers", phone_numbers cannot be nil.')
|
|
83
92
|
end
|
|
84
93
|
|
|
94
|
+
pattern = Regexp.new(/^[A-Za-z0-9_-]{1,40}$/)
|
|
95
|
+
if !@rcs_agent.nil? && @rcs_agent !~ pattern
|
|
96
|
+
invalid_properties.push("invalid value for \"rcs_agent\", must conform to the pattern #{pattern}.")
|
|
97
|
+
end
|
|
98
|
+
|
|
85
99
|
invalid_properties
|
|
86
100
|
end
|
|
87
101
|
|
|
@@ -90,6 +104,7 @@ module Bandwidth
|
|
|
90
104
|
def valid?
|
|
91
105
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
92
106
|
return false if @phone_numbers.nil?
|
|
107
|
+
return false if !@rcs_agent.nil? && @rcs_agent !~ Regexp.new(/^[A-Za-z0-9_-]{1,40}$/)
|
|
93
108
|
true
|
|
94
109
|
end
|
|
95
110
|
|
|
@@ -103,12 +118,28 @@ module Bandwidth
|
|
|
103
118
|
@phone_numbers = phone_numbers
|
|
104
119
|
end
|
|
105
120
|
|
|
121
|
+
# Custom attribute writer method with validation
|
|
122
|
+
# @param [Object] rcs_agent Value to be assigned
|
|
123
|
+
def rcs_agent=(rcs_agent)
|
|
124
|
+
if rcs_agent.nil?
|
|
125
|
+
fail ArgumentError, 'rcs_agent cannot be nil'
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
pattern = Regexp.new(/^[A-Za-z0-9_-]{1,40}$/)
|
|
129
|
+
if rcs_agent !~ pattern
|
|
130
|
+
fail ArgumentError, "invalid value for \"rcs_agent\", must conform to the pattern #{pattern}."
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
@rcs_agent = rcs_agent
|
|
134
|
+
end
|
|
135
|
+
|
|
106
136
|
# Checks equality by comparing each attribute.
|
|
107
137
|
# @param [Object] Object to be compared
|
|
108
138
|
def ==(o)
|
|
109
139
|
return true if self.equal?(o)
|
|
110
140
|
self.class == o.class &&
|
|
111
|
-
phone_numbers == o.phone_numbers
|
|
141
|
+
phone_numbers == o.phone_numbers &&
|
|
142
|
+
rcs_agent == o.rcs_agent
|
|
112
143
|
end
|
|
113
144
|
|
|
114
145
|
# @see the `==` method
|
|
@@ -120,7 +151,7 @@ module Bandwidth
|
|
|
120
151
|
# Calculates hash code according to all attributes.
|
|
121
152
|
# @return [Integer] Hash code
|
|
122
153
|
def hash
|
|
123
|
-
[phone_numbers].hash
|
|
154
|
+
[phone_numbers, rcs_agent].hash
|
|
124
155
|
end
|
|
125
156
|
|
|
126
157
|
# Builds the object from hash
|