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,39 @@
|
|
|
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 EndpointTypeEnum
|
|
18
|
+
WEBRTC = 'WEBRTC'.freeze
|
|
19
|
+
|
|
20
|
+
def self.all_vars
|
|
21
|
+
@all_vars ||= [WEBRTC].freeze
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Builds the enum from string
|
|
25
|
+
# @param [String] The enum value in the form of the string
|
|
26
|
+
# @return [String] The enum value
|
|
27
|
+
def self.build_from_hash(value)
|
|
28
|
+
new.build_from_hash(value)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Builds the enum from string
|
|
32
|
+
# @param [String] The enum value in the form of the string
|
|
33
|
+
# @return [String] The enum value
|
|
34
|
+
def build_from_hash(value)
|
|
35
|
+
return value if EndpointTypeEnum.all_vars.include?(value)
|
|
36
|
+
raise "Invalid ENUM value #{value} for class #EndpointTypeEnum"
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,311 @@
|
|
|
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 Endpoints < 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
|
+
class EnumAttributeValidator
|
|
35
|
+
attr_reader :datatype
|
|
36
|
+
attr_reader :allowable_values
|
|
37
|
+
|
|
38
|
+
def initialize(datatype, allowable_values)
|
|
39
|
+
@allowable_values = allowable_values.map do |value|
|
|
40
|
+
case datatype.to_s
|
|
41
|
+
when /Integer/i
|
|
42
|
+
value.to_i
|
|
43
|
+
when /Float/i
|
|
44
|
+
value.to_f
|
|
45
|
+
else
|
|
46
|
+
value
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def valid?(value)
|
|
52
|
+
!value || allowable_values.include?(value)
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
57
|
+
def self.attribute_map
|
|
58
|
+
{
|
|
59
|
+
:'endpoint_id' => :'endpointId',
|
|
60
|
+
:'type' => :'type',
|
|
61
|
+
:'status' => :'status',
|
|
62
|
+
:'creation_timestamp' => :'creationTimestamp',
|
|
63
|
+
:'expiration_timestamp' => :'expirationTimestamp',
|
|
64
|
+
:'tag' => :'tag'
|
|
65
|
+
}
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Returns attribute mapping this model knows about
|
|
69
|
+
def self.acceptable_attribute_map
|
|
70
|
+
attribute_map
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Returns all the JSON keys this model knows about
|
|
74
|
+
def self.acceptable_attributes
|
|
75
|
+
acceptable_attribute_map.values
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Attribute type mapping.
|
|
79
|
+
def self.openapi_types
|
|
80
|
+
{
|
|
81
|
+
:'endpoint_id' => :'String',
|
|
82
|
+
:'type' => :'EndpointTypeEnum',
|
|
83
|
+
:'status' => :'EndpointStatusEnum',
|
|
84
|
+
:'creation_timestamp' => :'Time',
|
|
85
|
+
:'expiration_timestamp' => :'Time',
|
|
86
|
+
:'tag' => :'String'
|
|
87
|
+
}
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# List of attributes with nullable: true
|
|
91
|
+
def self.openapi_nullable
|
|
92
|
+
Set.new([
|
|
93
|
+
])
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Initializes the object
|
|
97
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
98
|
+
def initialize(attributes = {})
|
|
99
|
+
if (!attributes.is_a?(Hash))
|
|
100
|
+
fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::Endpoints` initialize method'
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
104
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
105
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
106
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
107
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Endpoints`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
108
|
+
end
|
|
109
|
+
h[k.to_sym] = v
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if attributes.key?(:'endpoint_id')
|
|
113
|
+
self.endpoint_id = attributes[:'endpoint_id']
|
|
114
|
+
else
|
|
115
|
+
self.endpoint_id = nil
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if attributes.key?(:'type')
|
|
119
|
+
self.type = attributes[:'type']
|
|
120
|
+
else
|
|
121
|
+
self.type = nil
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'status')
|
|
125
|
+
self.status = attributes[:'status']
|
|
126
|
+
else
|
|
127
|
+
self.status = nil
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if attributes.key?(:'creation_timestamp')
|
|
131
|
+
self.creation_timestamp = attributes[:'creation_timestamp']
|
|
132
|
+
else
|
|
133
|
+
self.creation_timestamp = nil
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'expiration_timestamp')
|
|
137
|
+
self.expiration_timestamp = attributes[:'expiration_timestamp']
|
|
138
|
+
else
|
|
139
|
+
self.expiration_timestamp = nil
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if attributes.key?(:'tag')
|
|
143
|
+
self.tag = attributes[:'tag']
|
|
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 @endpoint_id.nil?
|
|
153
|
+
invalid_properties.push('invalid value for "endpoint_id", endpoint_id cannot be nil.')
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if @type.nil?
|
|
157
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if @status.nil?
|
|
161
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
if @creation_timestamp.nil?
|
|
165
|
+
invalid_properties.push('invalid value for "creation_timestamp", creation_timestamp cannot be nil.')
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
if @expiration_timestamp.nil?
|
|
169
|
+
invalid_properties.push('invalid value for "expiration_timestamp", expiration_timestamp cannot be nil.')
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
invalid_properties
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Check to see if the all the properties in the model are valid
|
|
176
|
+
# @return true if the model is valid
|
|
177
|
+
def valid?
|
|
178
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
179
|
+
return false if @endpoint_id.nil?
|
|
180
|
+
return false if @type.nil?
|
|
181
|
+
return false if @status.nil?
|
|
182
|
+
return false if @creation_timestamp.nil?
|
|
183
|
+
return false if @expiration_timestamp.nil?
|
|
184
|
+
true
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Custom attribute writer method with validation
|
|
188
|
+
# @param [Object] endpoint_id Value to be assigned
|
|
189
|
+
def endpoint_id=(endpoint_id)
|
|
190
|
+
if endpoint_id.nil?
|
|
191
|
+
fail ArgumentError, 'endpoint_id cannot be nil'
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
@endpoint_id = endpoint_id
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Custom attribute writer method with validation
|
|
198
|
+
# @param [Object] type Value to be assigned
|
|
199
|
+
def type=(type)
|
|
200
|
+
if type.nil?
|
|
201
|
+
fail ArgumentError, 'type cannot be nil'
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
@type = type
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Custom attribute writer method with validation
|
|
208
|
+
# @param [Object] status Value to be assigned
|
|
209
|
+
def status=(status)
|
|
210
|
+
if status.nil?
|
|
211
|
+
fail ArgumentError, 'status cannot be nil'
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
@status = status
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Custom attribute writer method with validation
|
|
218
|
+
# @param [Object] creation_timestamp Value to be assigned
|
|
219
|
+
def creation_timestamp=(creation_timestamp)
|
|
220
|
+
if creation_timestamp.nil?
|
|
221
|
+
fail ArgumentError, 'creation_timestamp cannot be nil'
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
@creation_timestamp = creation_timestamp
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Custom attribute writer method with validation
|
|
228
|
+
# @param [Object] expiration_timestamp Value to be assigned
|
|
229
|
+
def expiration_timestamp=(expiration_timestamp)
|
|
230
|
+
if expiration_timestamp.nil?
|
|
231
|
+
fail ArgumentError, 'expiration_timestamp cannot be nil'
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
@expiration_timestamp = expiration_timestamp
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
# Custom attribute writer method with validation
|
|
238
|
+
# @param [Object] tag Value to be assigned
|
|
239
|
+
def tag=(tag)
|
|
240
|
+
if tag.nil?
|
|
241
|
+
fail ArgumentError, 'tag cannot be nil'
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
@tag = tag
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
# Checks equality by comparing each attribute.
|
|
248
|
+
# @param [Object] Object to be compared
|
|
249
|
+
def ==(o)
|
|
250
|
+
return true if self.equal?(o)
|
|
251
|
+
self.class == o.class &&
|
|
252
|
+
endpoint_id == o.endpoint_id &&
|
|
253
|
+
type == o.type &&
|
|
254
|
+
status == o.status &&
|
|
255
|
+
creation_timestamp == o.creation_timestamp &&
|
|
256
|
+
expiration_timestamp == o.expiration_timestamp &&
|
|
257
|
+
tag == o.tag
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
# @see the `==` method
|
|
261
|
+
# @param [Object] Object to be compared
|
|
262
|
+
def eql?(o)
|
|
263
|
+
self == o
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
# Calculates hash code according to all attributes.
|
|
267
|
+
# @return [Integer] Hash code
|
|
268
|
+
def hash
|
|
269
|
+
[endpoint_id, type, status, creation_timestamp, expiration_timestamp, tag].hash
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
# Builds the object from hash
|
|
273
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
274
|
+
# @return [Object] Returns the model itself
|
|
275
|
+
def self.build_from_hash(attributes)
|
|
276
|
+
return nil unless attributes.is_a?(Hash)
|
|
277
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
278
|
+
transformed_hash = {}
|
|
279
|
+
openapi_types.each_pair do |key, type|
|
|
280
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
281
|
+
transformed_hash["#{key}"] = nil
|
|
282
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
283
|
+
# check to ensure the input is an array given that the attribute
|
|
284
|
+
# is documented as an array but the input is not
|
|
285
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
286
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
287
|
+
end
|
|
288
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
289
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
290
|
+
end
|
|
291
|
+
end
|
|
292
|
+
new(transformed_hash)
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
# Returns the object in the form of hash
|
|
296
|
+
# @return [Hash] Returns the object in the form of hash
|
|
297
|
+
def to_hash
|
|
298
|
+
hash = {}
|
|
299
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
300
|
+
value = self.send(attr)
|
|
301
|
+
if value.nil?
|
|
302
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
303
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
hash[param] = _to_hash(value)
|
|
307
|
+
end
|
|
308
|
+
hash
|
|
309
|
+
end
|
|
310
|
+
end
|
|
311
|
+
end
|
|
@@ -20,7 +20,7 @@ module Bandwidth
|
|
|
20
20
|
|
|
21
21
|
attr_accessor :type
|
|
22
22
|
|
|
23
|
-
# The destination phone number the message was sent to.
|
|
23
|
+
# The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message.
|
|
24
24
|
attr_accessor :to
|
|
25
25
|
|
|
26
26
|
# A detailed description of the event described by the callback.
|
|
@@ -28,7 +28,7 @@ module Bandwidth
|
|
|
28
28
|
|
|
29
29
|
attr_accessor :message
|
|
30
30
|
|
|
31
|
-
# The name of the Authorized Message Provider (AMP) that handled this message.
|
|
31
|
+
# 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.
|
|
32
32
|
attr_accessor :carrier_name
|
|
33
33
|
|
|
34
34
|
class EnumAttributeValidator
|
|
@@ -0,0 +1,229 @@
|
|
|
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 ListEndpointsResponse < ApiModelBase
|
|
18
|
+
attr_accessor :links
|
|
19
|
+
|
|
20
|
+
attr_accessor :page
|
|
21
|
+
|
|
22
|
+
attr_accessor :data
|
|
23
|
+
|
|
24
|
+
attr_accessor :errors
|
|
25
|
+
|
|
26
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
27
|
+
def self.attribute_map
|
|
28
|
+
{
|
|
29
|
+
:'links' => :'links',
|
|
30
|
+
:'page' => :'page',
|
|
31
|
+
:'data' => :'data',
|
|
32
|
+
:'errors' => :'errors'
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns attribute mapping this model knows about
|
|
37
|
+
def self.acceptable_attribute_map
|
|
38
|
+
attribute_map
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Returns all the JSON keys this model knows about
|
|
42
|
+
def self.acceptable_attributes
|
|
43
|
+
acceptable_attribute_map.values
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Attribute type mapping.
|
|
47
|
+
def self.openapi_types
|
|
48
|
+
{
|
|
49
|
+
:'links' => :'Array<BrtcLink>',
|
|
50
|
+
:'page' => :'Page',
|
|
51
|
+
:'data' => :'Array<Endpoints>',
|
|
52
|
+
:'errors' => :'Array<BrtcError>'
|
|
53
|
+
}
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# List of attributes with nullable: true
|
|
57
|
+
def self.openapi_nullable
|
|
58
|
+
Set.new([
|
|
59
|
+
])
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Initializes the object
|
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
64
|
+
def initialize(attributes = {})
|
|
65
|
+
if (!attributes.is_a?(Hash))
|
|
66
|
+
fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::ListEndpointsResponse` initialize method'
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
71
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
72
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ListEndpointsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
74
|
+
end
|
|
75
|
+
h[k.to_sym] = v
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'links')
|
|
79
|
+
if (value = attributes[:'links']).is_a?(Array)
|
|
80
|
+
self.links = value
|
|
81
|
+
end
|
|
82
|
+
else
|
|
83
|
+
self.links = nil
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
if attributes.key?(:'page')
|
|
87
|
+
self.page = attributes[:'page']
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
if attributes.key?(:'data')
|
|
91
|
+
if (value = attributes[:'data']).is_a?(Array)
|
|
92
|
+
self.data = value
|
|
93
|
+
end
|
|
94
|
+
else
|
|
95
|
+
self.data = nil
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
if attributes.key?(:'errors')
|
|
99
|
+
if (value = attributes[:'errors']).is_a?(Array)
|
|
100
|
+
self.errors = value
|
|
101
|
+
end
|
|
102
|
+
else
|
|
103
|
+
self.errors = nil
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
108
|
+
# @return Array for valid properties with the reasons
|
|
109
|
+
def list_invalid_properties
|
|
110
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
111
|
+
invalid_properties = Array.new
|
|
112
|
+
if @links.nil?
|
|
113
|
+
invalid_properties.push('invalid value for "links", links cannot be nil.')
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if @data.nil?
|
|
117
|
+
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if @errors.nil?
|
|
121
|
+
invalid_properties.push('invalid value for "errors", errors cannot be nil.')
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
invalid_properties
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Check to see if the all the properties in the model are valid
|
|
128
|
+
# @return true if the model is valid
|
|
129
|
+
def valid?
|
|
130
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
131
|
+
return false if @links.nil?
|
|
132
|
+
return false if @data.nil?
|
|
133
|
+
return false if @errors.nil?
|
|
134
|
+
true
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Custom attribute writer method with validation
|
|
138
|
+
# @param [Object] links Value to be assigned
|
|
139
|
+
def links=(links)
|
|
140
|
+
if links.nil?
|
|
141
|
+
fail ArgumentError, 'links cannot be nil'
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
@links = links
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Custom attribute writer method with validation
|
|
148
|
+
# @param [Object] data Value to be assigned
|
|
149
|
+
def data=(data)
|
|
150
|
+
if data.nil?
|
|
151
|
+
fail ArgumentError, 'data cannot be nil'
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
@data = data
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Custom attribute writer method with validation
|
|
158
|
+
# @param [Object] errors Value to be assigned
|
|
159
|
+
def errors=(errors)
|
|
160
|
+
if errors.nil?
|
|
161
|
+
fail ArgumentError, 'errors cannot be nil'
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
@errors = errors
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Checks equality by comparing each attribute.
|
|
168
|
+
# @param [Object] Object to be compared
|
|
169
|
+
def ==(o)
|
|
170
|
+
return true if self.equal?(o)
|
|
171
|
+
self.class == o.class &&
|
|
172
|
+
links == o.links &&
|
|
173
|
+
page == o.page &&
|
|
174
|
+
data == o.data &&
|
|
175
|
+
errors == o.errors
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# @see the `==` method
|
|
179
|
+
# @param [Object] Object to be compared
|
|
180
|
+
def eql?(o)
|
|
181
|
+
self == o
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# Calculates hash code according to all attributes.
|
|
185
|
+
# @return [Integer] Hash code
|
|
186
|
+
def hash
|
|
187
|
+
[links, page, data, errors].hash
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Builds the object from hash
|
|
191
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
192
|
+
# @return [Object] Returns the model itself
|
|
193
|
+
def self.build_from_hash(attributes)
|
|
194
|
+
return nil unless attributes.is_a?(Hash)
|
|
195
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
196
|
+
transformed_hash = {}
|
|
197
|
+
openapi_types.each_pair do |key, type|
|
|
198
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
199
|
+
transformed_hash["#{key}"] = nil
|
|
200
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
201
|
+
# check to ensure the input is an array given that the attribute
|
|
202
|
+
# is documented as an array but the input is not
|
|
203
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
204
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
205
|
+
end
|
|
206
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
207
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
new(transformed_hash)
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
# Returns the object in the form of hash
|
|
214
|
+
# @return [Hash] Returns the object in the form of hash
|
|
215
|
+
def to_hash
|
|
216
|
+
hash = {}
|
|
217
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
218
|
+
value = self.send(attr)
|
|
219
|
+
if value.nil?
|
|
220
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
221
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
hash[param] = _to_hash(value)
|
|
225
|
+
end
|
|
226
|
+
hash
|
|
227
|
+
end
|
|
228
|
+
end
|
|
229
|
+
end
|
|
@@ -40,7 +40,7 @@ module Bandwidth
|
|
|
40
40
|
|
|
41
41
|
attr_accessor :latest_message_delivery_status
|
|
42
42
|
|
|
43
|
-
# [DNI-Only](#section/DNI-Only). The date the phone number entered the status described in `latestMessageDeliveryStatus`.
|
|
43
|
+
# [DNI-Only](#section/DNI-Only). The date the phone number entered the status described in `latestMessageDeliveryStatus`. Think of this as the \"start time\" for that status. Value resets every time the `latestMessageDeliveryStatus` changes.
|
|
44
44
|
attr_accessor :initial_message_delivery_status_date
|
|
45
45
|
|
|
46
46
|
# [DNI-Only](#section/DNI-Only). The date bandwidth last received delivery status information for this phone number. Use this field to understand how up-to-date the `latestMessageDeliveryStatus` is. Value resets every time the `latestMessageDeliveryStatus` changes.
|
|
@@ -30,7 +30,7 @@ module Bandwidth
|
|
|
30
30
|
# Amount of silence (in seconds) before assuming the callee has finished speaking.
|
|
31
31
|
attr_accessor :speech_end_threshold
|
|
32
32
|
|
|
33
|
-
# When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing.
|
|
33
|
+
# When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value.
|
|
34
34
|
attr_accessor :machine_speech_end_threshold
|
|
35
35
|
|
|
36
36
|
# If set to 'true' and if an answering machine is detected, the 'answering-machine' callback will be delayed until the machine is done speaking, or an end of message tone is detected, or until the 'detectionTimeout' is exceeded. If false, the 'answering-machine' result is sent immediately.
|
|
@@ -21,7 +21,7 @@ module Bandwidth
|
|
|
21
21
|
# The phone number(s) the message should be sent to in E164 format.
|
|
22
22
|
attr_accessor :to
|
|
23
23
|
|
|
24
|
-
# Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message.
|
|
24
|
+
# Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter.
|
|
25
25
|
attr_accessor :from
|
|
26
26
|
|
|
27
27
|
# The contents of the text message. Must be 2048 characters or less.
|