bandwidth-sdk 13.1.4 → 14.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +15 -12
- data/README.md +45 -18
- data/bandwidth-sdk.gemspec +1 -1
- data/bandwidth.yml +1638 -589
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +1388 -420
- data/coverage/index.html +20846 -10460
- data/custom_templates/README.mustache +6 -6
- data/custom_templates/gemspec.mustache +1 -1
- data/docs/AdditionalDenialReason.md +22 -0
- data/docs/Address.md +30 -0
- data/docs/CallbackTypeEnum.md +15 -0
- data/docs/Contact.md +24 -0
- data/docs/Error.md +22 -0
- data/docs/FailureWebhook.md +28 -0
- data/docs/LinksObject.md +24 -0
- data/docs/MediaApi.md +1 -1
- data/docs/Message.md +1 -1
- data/docs/MessageCallback.md +28 -0
- data/docs/MessageCallbackMessage.md +40 -0
- data/docs/OptInWorkflow.md +20 -0
- data/docs/TelephoneNumber.md +18 -0
- data/docs/TfvBasicAuthentication.md +20 -0
- data/docs/TfvCallbackStatusEnum.md +15 -0
- data/docs/TfvError.md +22 -0
- data/docs/TfvStatus.md +32 -0
- data/docs/TfvStatusEnum.md +15 -0
- data/docs/TfvSubmissionInfo.md +34 -0
- data/docs/TfvSubmissionWrapper.md +18 -0
- data/docs/TollFreeVerificationApi.md +585 -0
- data/docs/VerificationDenialWebhook.md +32 -0
- data/docs/VerificationRequest.md +36 -0
- data/docs/VerificationUpdateRequest.md +34 -0
- data/docs/VerificationWebhook.md +24 -0
- data/docs/WebhookSubscription.md +30 -0
- data/docs/WebhookSubscriptionBasicAuthentication.md +20 -0
- data/docs/WebhookSubscriptionRequestSchema.md +22 -0
- data/docs/WebhookSubscriptionTypeEnum.md +15 -0
- data/docs/WebhookSubscriptionsListBody.md +22 -0
- data/lib/bandwidth-sdk/api/media_api.rb +1 -1
- data/lib/bandwidth-sdk/api/toll_free_verification_api.rb +614 -0
- data/lib/bandwidth-sdk/configuration.rb +48 -0
- data/lib/bandwidth-sdk/models/additional_denial_reason.rb +254 -0
- data/lib/bandwidth-sdk/models/address.rb +501 -0
- data/lib/bandwidth-sdk/models/callback_type_enum.rb +42 -0
- data/lib/bandwidth-sdk/models/contact.rb +393 -0
- data/lib/bandwidth-sdk/models/error.rb +232 -0
- data/lib/bandwidth-sdk/models/failure_webhook.rb +304 -0
- data/lib/bandwidth-sdk/models/{transcription_metadata.rb → links_object.rb} +34 -35
- data/lib/bandwidth-sdk/models/{message_failed_callback.rb → message_callback.rb} +31 -13
- data/lib/bandwidth-sdk/models/{inbound_message_callback_message.rb → message_callback_message.rb} +6 -4
- data/lib/bandwidth-sdk/models/{inbound_message_callback.rb → opt_in_workflow.rb} +42 -61
- data/lib/bandwidth-sdk/models/telephone_number.rb +213 -0
- data/lib/bandwidth-sdk/models/{message_delivered_callback.rb → tfv_basic_authentication.rb} +58 -69
- data/lib/bandwidth-sdk/models/tfv_callback_status_enum.rb +40 -0
- data/lib/bandwidth-sdk/models/{message_sending_callback.rb → tfv_error.rb} +12 -64
- data/lib/bandwidth-sdk/models/{message_delivered_callback_message.rb → tfv_status.rb} +86 -162
- data/lib/bandwidth-sdk/models/tfv_status_enum.rb +43 -0
- data/lib/bandwidth-sdk/models/tfv_submission_info.rb +452 -0
- data/lib/bandwidth-sdk/models/{transcription_list.rb → tfv_submission_wrapper.rb} +12 -14
- data/lib/bandwidth-sdk/models/verification_denial_webhook.rb +325 -0
- data/lib/bandwidth-sdk/models/verification_request.rb +547 -0
- data/lib/bandwidth-sdk/models/verification_update_request.rb +501 -0
- data/lib/bandwidth-sdk/models/verification_webhook.rb +303 -0
- data/lib/bandwidth-sdk/models/{message_failed_callback_message.rb → webhook_subscription.rb} +68 -158
- data/lib/bandwidth-sdk/models/webhook_subscription_basic_authentication.rb +274 -0
- data/lib/bandwidth-sdk/models/webhook_subscription_request_schema.rb +306 -0
- data/lib/bandwidth-sdk/models/webhook_subscription_type_enum.rb +40 -0
- data/lib/bandwidth-sdk/models/webhook_subscriptions_list_body.rb +242 -0
- data/lib/bandwidth-sdk/version.rb +1 -1
- data/lib/bandwidth-sdk.rb +28 -8
- data/openapi-config.yml +1 -1
- data/spec/call_utils.rb +2 -2
- data/spec/smoke/toll_free_verification_api_spec.rb +69 -0
- data/spec/spec_helper.rb +1 -1
- data/spec/unit/api/mfa_api_spec.rb +1 -1
- data/spec/unit/api/toll_free_verification_api_spec.rb +278 -0
- data/spec/unit/client/api_client_spec.rb +1 -1
- metadata +111 -62
- data/lib/bandwidth-sdk/models/disconenct_callback.rb +0 -405
- data/lib/bandwidth-sdk/models/message_sending_callback_message.rb +0 -418
@@ -14,26 +14,16 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module Bandwidth
|
17
|
-
|
18
|
-
class InboundMessageCallback
|
19
|
-
attr_accessor :time
|
20
|
-
|
21
|
-
attr_accessor :type
|
22
|
-
|
23
|
-
attr_accessor :to
|
24
|
-
|
17
|
+
class OptInWorkflow
|
25
18
|
attr_accessor :description
|
26
19
|
|
27
|
-
attr_accessor :
|
20
|
+
attr_accessor :image_urls
|
28
21
|
|
29
22
|
# Attribute mapping from ruby-style variable name to JSON key.
|
30
23
|
def self.attribute_map
|
31
24
|
{
|
32
|
-
:'time' => :'time',
|
33
|
-
:'type' => :'type',
|
34
|
-
:'to' => :'to',
|
35
25
|
:'description' => :'description',
|
36
|
-
:'
|
26
|
+
:'image_urls' => :'imageUrls'
|
37
27
|
}
|
38
28
|
end
|
39
29
|
|
@@ -45,11 +35,8 @@ module Bandwidth
|
|
45
35
|
# Attribute type mapping.
|
46
36
|
def self.openapi_types
|
47
37
|
{
|
48
|
-
:'time' => :'Time',
|
49
|
-
:'type' => :'String',
|
50
|
-
:'to' => :'String',
|
51
38
|
:'description' => :'String',
|
52
|
-
:'
|
39
|
+
:'image_urls' => :'Array<String>'
|
53
40
|
}
|
54
41
|
end
|
55
42
|
|
@@ -63,45 +50,29 @@ module Bandwidth
|
|
63
50
|
# @param [Hash] attributes Model attributes in the form of hash
|
64
51
|
def initialize(attributes = {})
|
65
52
|
if (!attributes.is_a?(Hash))
|
66
|
-
fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::
|
53
|
+
fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::OptInWorkflow` initialize method'
|
67
54
|
end
|
68
55
|
|
69
56
|
# check to see if the attribute exists and convert string to symbol for hash key
|
70
57
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
71
58
|
if (!self.class.attribute_map.key?(k.to_sym))
|
72
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::
|
59
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::OptInWorkflow`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
73
60
|
end
|
74
61
|
h[k.to_sym] = v
|
75
62
|
}
|
76
63
|
|
77
|
-
if attributes.key?(:'time')
|
78
|
-
self.time = attributes[:'time']
|
79
|
-
else
|
80
|
-
self.time = nil
|
81
|
-
end
|
82
|
-
|
83
|
-
if attributes.key?(:'type')
|
84
|
-
self.type = attributes[:'type']
|
85
|
-
else
|
86
|
-
self.type = nil
|
87
|
-
end
|
88
|
-
|
89
|
-
if attributes.key?(:'to')
|
90
|
-
self.to = attributes[:'to']
|
91
|
-
else
|
92
|
-
self.to = nil
|
93
|
-
end
|
94
|
-
|
95
64
|
if attributes.key?(:'description')
|
96
65
|
self.description = attributes[:'description']
|
97
66
|
else
|
98
67
|
self.description = nil
|
99
68
|
end
|
100
69
|
|
101
|
-
if attributes.key?(:'
|
102
|
-
|
70
|
+
if attributes.key?(:'image_urls')
|
71
|
+
if (value = attributes[:'image_urls']).is_a?(Array)
|
72
|
+
self.image_urls = value
|
73
|
+
end
|
103
74
|
else
|
104
|
-
self.
|
75
|
+
self.image_urls = nil
|
105
76
|
end
|
106
77
|
end
|
107
78
|
|
@@ -110,24 +81,20 @@ module Bandwidth
|
|
110
81
|
def list_invalid_properties
|
111
82
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
112
83
|
invalid_properties = Array.new
|
113
|
-
if @
|
114
|
-
invalid_properties.push('invalid value for "
|
115
|
-
end
|
116
|
-
|
117
|
-
if @type.nil?
|
118
|
-
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
84
|
+
if @description.nil?
|
85
|
+
invalid_properties.push('invalid value for "description", description cannot be nil.')
|
119
86
|
end
|
120
87
|
|
121
|
-
if @
|
122
|
-
invalid_properties.push('invalid value for "
|
88
|
+
if @description.to_s.length > 500
|
89
|
+
invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 500.')
|
123
90
|
end
|
124
91
|
|
125
|
-
if @description.
|
126
|
-
invalid_properties.push('invalid value for "description",
|
92
|
+
if @description.to_s.length < 1
|
93
|
+
invalid_properties.push('invalid value for "description", the character length must be great than or equal to 1.')
|
127
94
|
end
|
128
95
|
|
129
|
-
if @
|
130
|
-
invalid_properties.push('invalid value for "
|
96
|
+
if @image_urls.nil?
|
97
|
+
invalid_properties.push('invalid value for "image_urls", image_urls cannot be nil.')
|
131
98
|
end
|
132
99
|
|
133
100
|
invalid_properties
|
@@ -137,24 +104,38 @@ module Bandwidth
|
|
137
104
|
# @return true if the model is valid
|
138
105
|
def valid?
|
139
106
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
140
|
-
return false if @time.nil?
|
141
|
-
return false if @type.nil?
|
142
|
-
return false if @to.nil?
|
143
107
|
return false if @description.nil?
|
144
|
-
return false if @
|
108
|
+
return false if @description.to_s.length > 500
|
109
|
+
return false if @description.to_s.length < 1
|
110
|
+
return false if @image_urls.nil?
|
145
111
|
true
|
146
112
|
end
|
147
113
|
|
114
|
+
# Custom attribute writer method with validation
|
115
|
+
# @param [Object] description Value to be assigned
|
116
|
+
def description=(description)
|
117
|
+
if description.nil?
|
118
|
+
fail ArgumentError, 'description cannot be nil'
|
119
|
+
end
|
120
|
+
|
121
|
+
if description.to_s.length > 500
|
122
|
+
fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 500.'
|
123
|
+
end
|
124
|
+
|
125
|
+
if description.to_s.length < 1
|
126
|
+
fail ArgumentError, 'invalid value for "description", the character length must be great than or equal to 1.'
|
127
|
+
end
|
128
|
+
|
129
|
+
@description = description
|
130
|
+
end
|
131
|
+
|
148
132
|
# Checks equality by comparing each attribute.
|
149
133
|
# @param [Object] Object to be compared
|
150
134
|
def ==(o)
|
151
135
|
return true if self.equal?(o)
|
152
136
|
self.class == o.class &&
|
153
|
-
time == o.time &&
|
154
|
-
type == o.type &&
|
155
|
-
to == o.to &&
|
156
137
|
description == o.description &&
|
157
|
-
|
138
|
+
image_urls == o.image_urls
|
158
139
|
end
|
159
140
|
|
160
141
|
# @see the `==` method
|
@@ -166,7 +147,7 @@ module Bandwidth
|
|
166
147
|
# Calculates hash code according to all attributes.
|
167
148
|
# @return [Integer] Hash code
|
168
149
|
def hash
|
169
|
-
[
|
150
|
+
[description, image_urls].hash
|
170
151
|
end
|
171
152
|
|
172
153
|
# Builds the object from hash
|
@@ -0,0 +1,213 @@
|
|
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.8.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Bandwidth
|
17
|
+
class TelephoneNumber
|
18
|
+
# Simple Telephone Number.
|
19
|
+
attr_accessor :telephone_number
|
20
|
+
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
+
def self.attribute_map
|
23
|
+
{
|
24
|
+
:'telephone_number' => :'telephoneNumber'
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
# Returns all the JSON keys this model knows about
|
29
|
+
def self.acceptable_attributes
|
30
|
+
attribute_map.values
|
31
|
+
end
|
32
|
+
|
33
|
+
# Attribute type mapping.
|
34
|
+
def self.openapi_types
|
35
|
+
{
|
36
|
+
:'telephone_number' => :'String'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# List of attributes with nullable: true
|
41
|
+
def self.openapi_nullable
|
42
|
+
Set.new([
|
43
|
+
])
|
44
|
+
end
|
45
|
+
|
46
|
+
# Initializes the object
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
48
|
+
def initialize(attributes = {})
|
49
|
+
if (!attributes.is_a?(Hash))
|
50
|
+
fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::TelephoneNumber` initialize method'
|
51
|
+
end
|
52
|
+
|
53
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
54
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
55
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::TelephoneNumber`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
57
|
+
end
|
58
|
+
h[k.to_sym] = v
|
59
|
+
}
|
60
|
+
|
61
|
+
if attributes.key?(:'telephone_number')
|
62
|
+
self.telephone_number = attributes[:'telephone_number']
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
67
|
+
# @return Array for valid properties with the reasons
|
68
|
+
def list_invalid_properties
|
69
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
70
|
+
invalid_properties = Array.new
|
71
|
+
invalid_properties
|
72
|
+
end
|
73
|
+
|
74
|
+
# Check to see if the all the properties in the model are valid
|
75
|
+
# @return true if the model is valid
|
76
|
+
def valid?
|
77
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
78
|
+
true
|
79
|
+
end
|
80
|
+
|
81
|
+
# Checks equality by comparing each attribute.
|
82
|
+
# @param [Object] Object to be compared
|
83
|
+
def ==(o)
|
84
|
+
return true if self.equal?(o)
|
85
|
+
self.class == o.class &&
|
86
|
+
telephone_number == o.telephone_number
|
87
|
+
end
|
88
|
+
|
89
|
+
# @see the `==` method
|
90
|
+
# @param [Object] Object to be compared
|
91
|
+
def eql?(o)
|
92
|
+
self == o
|
93
|
+
end
|
94
|
+
|
95
|
+
# Calculates hash code according to all attributes.
|
96
|
+
# @return [Integer] Hash code
|
97
|
+
def hash
|
98
|
+
[telephone_number].hash
|
99
|
+
end
|
100
|
+
|
101
|
+
# Builds the object from hash
|
102
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
103
|
+
# @return [Object] Returns the model itself
|
104
|
+
def self.build_from_hash(attributes)
|
105
|
+
return nil unless attributes.is_a?(Hash)
|
106
|
+
attributes = attributes.transform_keys(&:to_sym)
|
107
|
+
transformed_hash = {}
|
108
|
+
openapi_types.each_pair do |key, type|
|
109
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
110
|
+
transformed_hash["#{key}"] = nil
|
111
|
+
elsif type =~ /\AArray<(.*)>/i
|
112
|
+
# check to ensure the input is an array given that the attribute
|
113
|
+
# is documented as an array but the input is not
|
114
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
115
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
116
|
+
end
|
117
|
+
elsif !attributes[attribute_map[key]].nil?
|
118
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
119
|
+
end
|
120
|
+
end
|
121
|
+
new(transformed_hash)
|
122
|
+
end
|
123
|
+
|
124
|
+
# Deserializes the data based on type
|
125
|
+
# @param string type Data type
|
126
|
+
# @param string value Value to be deserialized
|
127
|
+
# @return [Object] Deserialized data
|
128
|
+
def self._deserialize(type, value)
|
129
|
+
case type.to_sym
|
130
|
+
when :Time
|
131
|
+
Time.parse(value)
|
132
|
+
when :Date
|
133
|
+
Date.parse(value)
|
134
|
+
when :String
|
135
|
+
value.to_s
|
136
|
+
when :Integer
|
137
|
+
value.to_i
|
138
|
+
when :Float
|
139
|
+
value.to_f
|
140
|
+
when :Boolean
|
141
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
142
|
+
true
|
143
|
+
else
|
144
|
+
false
|
145
|
+
end
|
146
|
+
when :Object
|
147
|
+
# generic object (usually a Hash), return directly
|
148
|
+
value
|
149
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
150
|
+
inner_type = Regexp.last_match[:inner_type]
|
151
|
+
value.map { |v| _deserialize(inner_type, v) }
|
152
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
153
|
+
k_type = Regexp.last_match[:k_type]
|
154
|
+
v_type = Regexp.last_match[:v_type]
|
155
|
+
{}.tap do |hash|
|
156
|
+
value.each do |k, v|
|
157
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
else # model
|
161
|
+
# models (e.g. Pet) or oneOf
|
162
|
+
klass = Bandwidth.const_get(type)
|
163
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
# Returns the string representation of the object
|
168
|
+
# @return [String] String presentation of the object
|
169
|
+
def to_s
|
170
|
+
to_hash.to_s
|
171
|
+
end
|
172
|
+
|
173
|
+
# to_body is an alias to to_hash (backward compatibility)
|
174
|
+
# @return [Hash] Returns the object in the form of hash
|
175
|
+
def to_body
|
176
|
+
to_hash
|
177
|
+
end
|
178
|
+
|
179
|
+
# Returns the object in the form of hash
|
180
|
+
# @return [Hash] Returns the object in the form of hash
|
181
|
+
def to_hash
|
182
|
+
hash = {}
|
183
|
+
self.class.attribute_map.each_pair do |attr, param|
|
184
|
+
value = self.send(attr)
|
185
|
+
if value.nil?
|
186
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
187
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
188
|
+
end
|
189
|
+
|
190
|
+
hash[param] = _to_hash(value)
|
191
|
+
end
|
192
|
+
hash
|
193
|
+
end
|
194
|
+
|
195
|
+
# Outputs non-array value in the form of hash
|
196
|
+
# For object, use to_hash. Otherwise, just return the value
|
197
|
+
# @param [Object] value Any valid value
|
198
|
+
# @return [Hash] Returns the value in the form of hash
|
199
|
+
def _to_hash(value)
|
200
|
+
if value.is_a?(Array)
|
201
|
+
value.compact.map { |v| _to_hash(v) }
|
202
|
+
elsif value.is_a?(Hash)
|
203
|
+
{}.tap do |hash|
|
204
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
205
|
+
end
|
206
|
+
elsif value.respond_to? :to_hash
|
207
|
+
value.to_hash
|
208
|
+
else
|
209
|
+
value
|
210
|
+
end
|
211
|
+
end
|
212
|
+
end
|
213
|
+
end
|
@@ -14,26 +14,16 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module Bandwidth
|
17
|
-
|
18
|
-
|
19
|
-
attr_accessor :time
|
17
|
+
class TfvBasicAuthentication
|
18
|
+
attr_accessor :username
|
20
19
|
|
21
|
-
attr_accessor :
|
22
|
-
|
23
|
-
attr_accessor :to
|
24
|
-
|
25
|
-
attr_accessor :description
|
26
|
-
|
27
|
-
attr_accessor :message
|
20
|
+
attr_accessor :password
|
28
21
|
|
29
22
|
# Attribute mapping from ruby-style variable name to JSON key.
|
30
23
|
def self.attribute_map
|
31
24
|
{
|
32
|
-
:'
|
33
|
-
:'
|
34
|
-
:'to' => :'to',
|
35
|
-
:'description' => :'description',
|
36
|
-
:'message' => :'message'
|
25
|
+
:'username' => :'username',
|
26
|
+
:'password' => :'password'
|
37
27
|
}
|
38
28
|
end
|
39
29
|
|
@@ -45,11 +35,8 @@ module Bandwidth
|
|
45
35
|
# Attribute type mapping.
|
46
36
|
def self.openapi_types
|
47
37
|
{
|
48
|
-
:'
|
49
|
-
:'
|
50
|
-
:'to' => :'String',
|
51
|
-
:'description' => :'String',
|
52
|
-
:'message' => :'MessageDeliveredCallbackMessage'
|
38
|
+
:'username' => :'String',
|
39
|
+
:'password' => :'String'
|
53
40
|
}
|
54
41
|
end
|
55
42
|
|
@@ -63,45 +50,27 @@ module Bandwidth
|
|
63
50
|
# @param [Hash] attributes Model attributes in the form of hash
|
64
51
|
def initialize(attributes = {})
|
65
52
|
if (!attributes.is_a?(Hash))
|
66
|
-
fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::
|
53
|
+
fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::TfvBasicAuthentication` initialize method'
|
67
54
|
end
|
68
55
|
|
69
56
|
# check to see if the attribute exists and convert string to symbol for hash key
|
70
57
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
71
58
|
if (!self.class.attribute_map.key?(k.to_sym))
|
72
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::
|
59
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::TfvBasicAuthentication`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
73
60
|
end
|
74
61
|
h[k.to_sym] = v
|
75
62
|
}
|
76
63
|
|
77
|
-
if attributes.key?(:'
|
78
|
-
self.
|
64
|
+
if attributes.key?(:'username')
|
65
|
+
self.username = attributes[:'username']
|
79
66
|
else
|
80
|
-
self.
|
67
|
+
self.username = nil
|
81
68
|
end
|
82
69
|
|
83
|
-
if attributes.key?(:'
|
84
|
-
self.
|
70
|
+
if attributes.key?(:'password')
|
71
|
+
self.password = attributes[:'password']
|
85
72
|
else
|
86
|
-
self.
|
87
|
-
end
|
88
|
-
|
89
|
-
if attributes.key?(:'to')
|
90
|
-
self.to = attributes[:'to']
|
91
|
-
else
|
92
|
-
self.to = nil
|
93
|
-
end
|
94
|
-
|
95
|
-
if attributes.key?(:'description')
|
96
|
-
self.description = attributes[:'description']
|
97
|
-
else
|
98
|
-
self.description = nil
|
99
|
-
end
|
100
|
-
|
101
|
-
if attributes.key?(:'message')
|
102
|
-
self.message = attributes[:'message']
|
103
|
-
else
|
104
|
-
self.message = nil
|
73
|
+
self.password = nil
|
105
74
|
end
|
106
75
|
end
|
107
76
|
|
@@ -110,24 +79,20 @@ module Bandwidth
|
|
110
79
|
def list_invalid_properties
|
111
80
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
112
81
|
invalid_properties = Array.new
|
113
|
-
if @
|
114
|
-
invalid_properties.push('invalid value for "
|
115
|
-
end
|
116
|
-
|
117
|
-
if @type.nil?
|
118
|
-
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
82
|
+
if @username.nil?
|
83
|
+
invalid_properties.push('invalid value for "username", username cannot be nil.')
|
119
84
|
end
|
120
85
|
|
121
|
-
if @
|
122
|
-
invalid_properties.push('invalid value for "
|
86
|
+
if @username.to_s.length > 100
|
87
|
+
invalid_properties.push('invalid value for "username", the character length must be smaller than or equal to 100.')
|
123
88
|
end
|
124
89
|
|
125
|
-
if @
|
126
|
-
invalid_properties.push('invalid value for "
|
90
|
+
if @password.nil?
|
91
|
+
invalid_properties.push('invalid value for "password", password cannot be nil.')
|
127
92
|
end
|
128
93
|
|
129
|
-
if @
|
130
|
-
invalid_properties.push('invalid value for "
|
94
|
+
if @password.to_s.length > 200
|
95
|
+
invalid_properties.push('invalid value for "password", the character length must be smaller than or equal to 200.')
|
131
96
|
end
|
132
97
|
|
133
98
|
invalid_properties
|
@@ -137,24 +102,48 @@ module Bandwidth
|
|
137
102
|
# @return true if the model is valid
|
138
103
|
def valid?
|
139
104
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
140
|
-
return false if @
|
141
|
-
return false if @
|
142
|
-
return false if @
|
143
|
-
return false if @
|
144
|
-
return false if @message.nil?
|
105
|
+
return false if @username.nil?
|
106
|
+
return false if @username.to_s.length > 100
|
107
|
+
return false if @password.nil?
|
108
|
+
return false if @password.to_s.length > 200
|
145
109
|
true
|
146
110
|
end
|
147
111
|
|
112
|
+
# Custom attribute writer method with validation
|
113
|
+
# @param [Object] username Value to be assigned
|
114
|
+
def username=(username)
|
115
|
+
if username.nil?
|
116
|
+
fail ArgumentError, 'username cannot be nil'
|
117
|
+
end
|
118
|
+
|
119
|
+
if username.to_s.length > 100
|
120
|
+
fail ArgumentError, 'invalid value for "username", the character length must be smaller than or equal to 100.'
|
121
|
+
end
|
122
|
+
|
123
|
+
@username = username
|
124
|
+
end
|
125
|
+
|
126
|
+
# Custom attribute writer method with validation
|
127
|
+
# @param [Object] password Value to be assigned
|
128
|
+
def password=(password)
|
129
|
+
if password.nil?
|
130
|
+
fail ArgumentError, 'password cannot be nil'
|
131
|
+
end
|
132
|
+
|
133
|
+
if password.to_s.length > 200
|
134
|
+
fail ArgumentError, 'invalid value for "password", the character length must be smaller than or equal to 200.'
|
135
|
+
end
|
136
|
+
|
137
|
+
@password = password
|
138
|
+
end
|
139
|
+
|
148
140
|
# Checks equality by comparing each attribute.
|
149
141
|
# @param [Object] Object to be compared
|
150
142
|
def ==(o)
|
151
143
|
return true if self.equal?(o)
|
152
144
|
self.class == o.class &&
|
153
|
-
|
154
|
-
|
155
|
-
to == o.to &&
|
156
|
-
description == o.description &&
|
157
|
-
message == o.message
|
145
|
+
username == o.username &&
|
146
|
+
password == o.password
|
158
147
|
end
|
159
148
|
|
160
149
|
# @see the `==` method
|
@@ -166,7 +155,7 @@ module Bandwidth
|
|
166
155
|
# Calculates hash code according to all attributes.
|
167
156
|
# @return [Integer] Hash code
|
168
157
|
def hash
|
169
|
-
[
|
158
|
+
[username, password].hash
|
170
159
|
end
|
171
160
|
|
172
161
|
# Builds the object from hash
|
@@ -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.8.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Bandwidth
|
17
|
+
class TfvCallbackStatusEnum
|
18
|
+
VERIFIED = 'VERIFIED'.freeze
|
19
|
+
UNVERIFIED = 'UNVERIFIED'.freeze
|
20
|
+
|
21
|
+
def self.all_vars
|
22
|
+
@all_vars ||= [VERIFIED, UNVERIFIED].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 TfvCallbackStatusEnum.all_vars.include?(value)
|
37
|
+
raise "Invalid ENUM value #{value} for class #TfvCallbackStatusEnum"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|