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,21 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module Bandwidth
|
17
|
-
#
|
18
|
-
class
|
19
|
-
attr_accessor :time
|
20
|
-
|
17
|
+
# A generic error object.
|
18
|
+
class TfvError
|
21
19
|
attr_accessor :type
|
22
20
|
|
23
|
-
attr_accessor :to
|
24
|
-
|
25
21
|
attr_accessor :description
|
26
22
|
|
27
|
-
|
23
|
+
# Each key of this errors object refers to a field of the submitted object (using dot notation for nested objects), with the field being a key to an array of one or more errors for that field.
|
24
|
+
attr_accessor :errors
|
28
25
|
|
29
26
|
# Attribute mapping from ruby-style variable name to JSON key.
|
30
27
|
def self.attribute_map
|
31
28
|
{
|
32
|
-
:'time' => :'time',
|
33
29
|
:'type' => :'type',
|
34
|
-
:'to' => :'to',
|
35
30
|
:'description' => :'description',
|
36
|
-
:'
|
31
|
+
:'errors' => :'errors'
|
37
32
|
}
|
38
33
|
end
|
39
34
|
|
@@ -45,11 +40,9 @@ module Bandwidth
|
|
45
40
|
# Attribute type mapping.
|
46
41
|
def self.openapi_types
|
47
42
|
{
|
48
|
-
:'time' => :'Time',
|
49
43
|
:'type' => :'String',
|
50
|
-
:'to' => :'String',
|
51
44
|
:'description' => :'String',
|
52
|
-
:'
|
45
|
+
:'errors' => :'Object'
|
53
46
|
}
|
54
47
|
end
|
55
48
|
|
@@ -63,45 +56,27 @@ module Bandwidth
|
|
63
56
|
# @param [Hash] attributes Model attributes in the form of hash
|
64
57
|
def initialize(attributes = {})
|
65
58
|
if (!attributes.is_a?(Hash))
|
66
|
-
fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::
|
59
|
+
fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::TfvError` initialize method'
|
67
60
|
end
|
68
61
|
|
69
62
|
# check to see if the attribute exists and convert string to symbol for hash key
|
70
63
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
71
64
|
if (!self.class.attribute_map.key?(k.to_sym))
|
72
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::TfvError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
73
66
|
end
|
74
67
|
h[k.to_sym] = v
|
75
68
|
}
|
76
69
|
|
77
|
-
if attributes.key?(:'time')
|
78
|
-
self.time = attributes[:'time']
|
79
|
-
else
|
80
|
-
self.time = nil
|
81
|
-
end
|
82
|
-
|
83
70
|
if attributes.key?(:'type')
|
84
71
|
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
72
|
end
|
94
73
|
|
95
74
|
if attributes.key?(:'description')
|
96
75
|
self.description = attributes[:'description']
|
97
|
-
else
|
98
|
-
self.description = nil
|
99
76
|
end
|
100
77
|
|
101
|
-
if attributes.key?(:'
|
102
|
-
self.
|
103
|
-
else
|
104
|
-
self.message = nil
|
78
|
+
if attributes.key?(:'errors')
|
79
|
+
self.errors = attributes[:'errors']
|
105
80
|
end
|
106
81
|
end
|
107
82
|
|
@@ -110,26 +85,6 @@ module Bandwidth
|
|
110
85
|
def list_invalid_properties
|
111
86
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
112
87
|
invalid_properties = Array.new
|
113
|
-
if @time.nil?
|
114
|
-
invalid_properties.push('invalid value for "time", time cannot be nil.')
|
115
|
-
end
|
116
|
-
|
117
|
-
if @type.nil?
|
118
|
-
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
119
|
-
end
|
120
|
-
|
121
|
-
if @to.nil?
|
122
|
-
invalid_properties.push('invalid value for "to", to cannot be nil.')
|
123
|
-
end
|
124
|
-
|
125
|
-
if @description.nil?
|
126
|
-
invalid_properties.push('invalid value for "description", description cannot be nil.')
|
127
|
-
end
|
128
|
-
|
129
|
-
if @message.nil?
|
130
|
-
invalid_properties.push('invalid value for "message", message cannot be nil.')
|
131
|
-
end
|
132
|
-
|
133
88
|
invalid_properties
|
134
89
|
end
|
135
90
|
|
@@ -137,11 +92,6 @@ module Bandwidth
|
|
137
92
|
# @return true if the model is valid
|
138
93
|
def valid?
|
139
94
|
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
|
-
return false if @description.nil?
|
144
|
-
return false if @message.nil?
|
145
95
|
true
|
146
96
|
end
|
147
97
|
|
@@ -150,11 +100,9 @@ module Bandwidth
|
|
150
100
|
def ==(o)
|
151
101
|
return true if self.equal?(o)
|
152
102
|
self.class == o.class &&
|
153
|
-
time == o.time &&
|
154
103
|
type == o.type &&
|
155
|
-
to == o.to &&
|
156
104
|
description == o.description &&
|
157
|
-
|
105
|
+
errors == o.errors
|
158
106
|
end
|
159
107
|
|
160
108
|
# @see the `==` method
|
@@ -166,7 +114,7 @@ module Bandwidth
|
|
166
114
|
# Calculates hash code according to all attributes.
|
167
115
|
# @return [Integer] Hash code
|
168
116
|
def hash
|
169
|
-
[
|
117
|
+
[type, description, errors].hash
|
170
118
|
end
|
171
119
|
|
172
120
|
# Builds the object from hash
|
@@ -14,31 +14,28 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module Bandwidth
|
17
|
-
|
18
|
-
|
19
|
-
attr_accessor :
|
17
|
+
class TfvStatus
|
18
|
+
# Toll-free telephone number in E.164 format.
|
19
|
+
attr_accessor :phone_number
|
20
20
|
|
21
|
-
attr_accessor :
|
21
|
+
attr_accessor :status
|
22
22
|
|
23
|
-
|
23
|
+
# Unique identifier (UUID) generated by Bandwidth to assist in tracking the verification status of a toll-free number - included in all webhook payloads.
|
24
|
+
attr_accessor :internal_ticket_number
|
24
25
|
|
25
|
-
|
26
|
+
# Explanation for why a verification request was declined.
|
27
|
+
attr_accessor :decline_reason_description
|
26
28
|
|
27
|
-
|
29
|
+
# Whether a Toll-Free Verification request qualifies for resubmission via PUT.
|
30
|
+
attr_accessor :resubmit_allowed
|
28
31
|
|
29
|
-
|
32
|
+
# Date and time the verification request was created.
|
33
|
+
attr_accessor :created_date_time
|
30
34
|
|
31
|
-
|
35
|
+
# Date and time the verification request was last modified.
|
36
|
+
attr_accessor :modified_date_time
|
32
37
|
|
33
|
-
attr_accessor :
|
34
|
-
|
35
|
-
attr_accessor :text
|
36
|
-
|
37
|
-
attr_accessor :tag
|
38
|
-
|
39
|
-
attr_accessor :media
|
40
|
-
|
41
|
-
attr_accessor :priority
|
38
|
+
attr_accessor :submission
|
42
39
|
|
43
40
|
class EnumAttributeValidator
|
44
41
|
attr_reader :datatype
|
@@ -65,18 +62,14 @@ module Bandwidth
|
|
65
62
|
# Attribute mapping from ruby-style variable name to JSON key.
|
66
63
|
def self.attribute_map
|
67
64
|
{
|
68
|
-
:'
|
69
|
-
:'
|
70
|
-
:'
|
71
|
-
:'
|
72
|
-
:'
|
73
|
-
:'
|
74
|
-
:'
|
75
|
-
:'
|
76
|
-
:'text' => :'text',
|
77
|
-
:'tag' => :'tag',
|
78
|
-
:'media' => :'media',
|
79
|
-
:'priority' => :'priority'
|
65
|
+
:'phone_number' => :'phoneNumber',
|
66
|
+
:'status' => :'status',
|
67
|
+
:'internal_ticket_number' => :'internalTicketNumber',
|
68
|
+
:'decline_reason_description' => :'declineReasonDescription',
|
69
|
+
:'resubmit_allowed' => :'resubmitAllowed',
|
70
|
+
:'created_date_time' => :'createdDateTime',
|
71
|
+
:'modified_date_time' => :'modifiedDateTime',
|
72
|
+
:'submission' => :'submission'
|
80
73
|
}
|
81
74
|
end
|
82
75
|
|
@@ -88,18 +81,14 @@ module Bandwidth
|
|
88
81
|
# Attribute type mapping.
|
89
82
|
def self.openapi_types
|
90
83
|
{
|
91
|
-
:'
|
92
|
-
:'
|
93
|
-
:'
|
94
|
-
:'
|
95
|
-
:'
|
96
|
-
:'
|
97
|
-
:'
|
98
|
-
:'
|
99
|
-
:'text' => :'String',
|
100
|
-
:'tag' => :'String',
|
101
|
-
:'media' => :'Array<String>',
|
102
|
-
:'priority' => :'PriorityEnum'
|
84
|
+
:'phone_number' => :'String',
|
85
|
+
:'status' => :'TfvStatusEnum',
|
86
|
+
:'internal_ticket_number' => :'String',
|
87
|
+
:'decline_reason_description' => :'String',
|
88
|
+
:'resubmit_allowed' => :'Boolean',
|
89
|
+
:'created_date_time' => :'Time',
|
90
|
+
:'modified_date_time' => :'Time',
|
91
|
+
:'submission' => :'TfvSubmissionInfo'
|
103
92
|
}
|
104
93
|
end
|
105
94
|
|
@@ -113,87 +102,47 @@ module Bandwidth
|
|
113
102
|
# @param [Hash] attributes Model attributes in the form of hash
|
114
103
|
def initialize(attributes = {})
|
115
104
|
if (!attributes.is_a?(Hash))
|
116
|
-
fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::
|
105
|
+
fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::TfvStatus` initialize method'
|
117
106
|
end
|
118
107
|
|
119
108
|
# check to see if the attribute exists and convert string to symbol for hash key
|
120
109
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
121
110
|
if (!self.class.attribute_map.key?(k.to_sym))
|
122
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::
|
111
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::TfvStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
123
112
|
end
|
124
113
|
h[k.to_sym] = v
|
125
114
|
}
|
126
115
|
|
127
|
-
if attributes.key?(:'
|
128
|
-
self.
|
129
|
-
else
|
130
|
-
self.id = nil
|
131
|
-
end
|
132
|
-
|
133
|
-
if attributes.key?(:'owner')
|
134
|
-
self.owner = attributes[:'owner']
|
135
|
-
else
|
136
|
-
self.owner = nil
|
137
|
-
end
|
138
|
-
|
139
|
-
if attributes.key?(:'application_id')
|
140
|
-
self.application_id = attributes[:'application_id']
|
141
|
-
else
|
142
|
-
self.application_id = nil
|
143
|
-
end
|
144
|
-
|
145
|
-
if attributes.key?(:'time')
|
146
|
-
self.time = attributes[:'time']
|
147
|
-
else
|
148
|
-
self.time = nil
|
116
|
+
if attributes.key?(:'phone_number')
|
117
|
+
self.phone_number = attributes[:'phone_number']
|
149
118
|
end
|
150
119
|
|
151
|
-
if attributes.key?(:'
|
152
|
-
self.
|
153
|
-
else
|
154
|
-
self.segment_count = nil
|
120
|
+
if attributes.key?(:'status')
|
121
|
+
self.status = attributes[:'status']
|
155
122
|
end
|
156
123
|
|
157
|
-
if attributes.key?(:'
|
158
|
-
self.
|
159
|
-
else
|
160
|
-
self.direction = nil
|
124
|
+
if attributes.key?(:'internal_ticket_number')
|
125
|
+
self.internal_ticket_number = attributes[:'internal_ticket_number']
|
161
126
|
end
|
162
127
|
|
163
|
-
if attributes.key?(:'
|
164
|
-
|
165
|
-
self.to = value
|
166
|
-
end
|
167
|
-
else
|
168
|
-
self.to = nil
|
128
|
+
if attributes.key?(:'decline_reason_description')
|
129
|
+
self.decline_reason_description = attributes[:'decline_reason_description']
|
169
130
|
end
|
170
131
|
|
171
|
-
if attributes.key?(:'
|
172
|
-
self.
|
173
|
-
else
|
174
|
-
self.from = nil
|
175
|
-
end
|
176
|
-
|
177
|
-
if attributes.key?(:'text')
|
178
|
-
self.text = attributes[:'text']
|
179
|
-
else
|
180
|
-
self.text = nil
|
132
|
+
if attributes.key?(:'resubmit_allowed')
|
133
|
+
self.resubmit_allowed = attributes[:'resubmit_allowed']
|
181
134
|
end
|
182
135
|
|
183
|
-
if attributes.key?(:'
|
184
|
-
self.
|
185
|
-
else
|
186
|
-
self.tag = nil
|
136
|
+
if attributes.key?(:'created_date_time')
|
137
|
+
self.created_date_time = attributes[:'created_date_time']
|
187
138
|
end
|
188
139
|
|
189
|
-
if attributes.key?(:'
|
190
|
-
|
191
|
-
self.media = value
|
192
|
-
end
|
140
|
+
if attributes.key?(:'modified_date_time')
|
141
|
+
self.modified_date_time = attributes[:'modified_date_time']
|
193
142
|
end
|
194
143
|
|
195
|
-
if attributes.key?(:'
|
196
|
-
self.
|
144
|
+
if attributes.key?(:'submission')
|
145
|
+
self.submission = attributes[:'submission']
|
197
146
|
end
|
198
147
|
end
|
199
148
|
|
@@ -202,44 +151,17 @@ module Bandwidth
|
|
202
151
|
def list_invalid_properties
|
203
152
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
204
153
|
invalid_properties = Array.new
|
205
|
-
if
|
206
|
-
invalid_properties.push('invalid value for "
|
207
|
-
end
|
208
|
-
|
209
|
-
if @owner.nil?
|
210
|
-
invalid_properties.push('invalid value for "owner", owner cannot be nil.')
|
211
|
-
end
|
212
|
-
|
213
|
-
if @application_id.nil?
|
214
|
-
invalid_properties.push('invalid value for "application_id", application_id cannot be nil.')
|
215
|
-
end
|
216
|
-
|
217
|
-
if @time.nil?
|
218
|
-
invalid_properties.push('invalid value for "time", time cannot be nil.')
|
219
|
-
end
|
220
|
-
|
221
|
-
if @segment_count.nil?
|
222
|
-
invalid_properties.push('invalid value for "segment_count", segment_count cannot be nil.')
|
223
|
-
end
|
224
|
-
|
225
|
-
if @direction.nil?
|
226
|
-
invalid_properties.push('invalid value for "direction", direction cannot be nil.')
|
227
|
-
end
|
228
|
-
|
229
|
-
if @to.nil?
|
230
|
-
invalid_properties.push('invalid value for "to", to cannot be nil.')
|
154
|
+
if !@phone_number.nil? && @phone_number.to_s.length > 12
|
155
|
+
invalid_properties.push('invalid value for "phone_number", the character length must be smaller than or equal to 12.')
|
231
156
|
end
|
232
157
|
|
233
|
-
if
|
234
|
-
invalid_properties.push('invalid value for "
|
158
|
+
if !@phone_number.nil? && @phone_number.to_s.length < 12
|
159
|
+
invalid_properties.push('invalid value for "phone_number", the character length must be great than or equal to 12.')
|
235
160
|
end
|
236
161
|
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
if @tag.nil?
|
242
|
-
invalid_properties.push('invalid value for "tag", tag cannot be nil.')
|
162
|
+
pattern = Regexp.new(/^\+1(800|833|844|855|866|877|888)[2-9]\d{6}$/)
|
163
|
+
if !@phone_number.nil? && @phone_number !~ pattern
|
164
|
+
invalid_properties.push("invalid value for \"phone_number\", must conform to the pattern #{pattern}.")
|
243
165
|
end
|
244
166
|
|
245
167
|
invalid_properties
|
@@ -249,27 +171,33 @@ module Bandwidth
|
|
249
171
|
# @return true if the model is valid
|
250
172
|
def valid?
|
251
173
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
252
|
-
return false if
|
253
|
-
return false if
|
254
|
-
return false if
|
255
|
-
return false if @time.nil?
|
256
|
-
return false if @segment_count.nil?
|
257
|
-
return false if @direction.nil?
|
258
|
-
return false if @to.nil?
|
259
|
-
return false if @from.nil?
|
260
|
-
return false if @text.nil?
|
261
|
-
return false if @tag.nil?
|
174
|
+
return false if !@phone_number.nil? && @phone_number.to_s.length > 12
|
175
|
+
return false if !@phone_number.nil? && @phone_number.to_s.length < 12
|
176
|
+
return false if !@phone_number.nil? && @phone_number !~ Regexp.new(/^\+1(800|833|844|855|866|877|888)[2-9]\d{6}$/)
|
262
177
|
true
|
263
178
|
end
|
264
179
|
|
265
180
|
# Custom attribute writer method with validation
|
266
|
-
# @param [Object]
|
267
|
-
def
|
268
|
-
if
|
269
|
-
fail ArgumentError, '
|
181
|
+
# @param [Object] phone_number Value to be assigned
|
182
|
+
def phone_number=(phone_number)
|
183
|
+
if phone_number.nil?
|
184
|
+
fail ArgumentError, 'phone_number cannot be nil'
|
185
|
+
end
|
186
|
+
|
187
|
+
if phone_number.to_s.length > 12
|
188
|
+
fail ArgumentError, 'invalid value for "phone_number", the character length must be smaller than or equal to 12.'
|
189
|
+
end
|
190
|
+
|
191
|
+
if phone_number.to_s.length < 12
|
192
|
+
fail ArgumentError, 'invalid value for "phone_number", the character length must be great than or equal to 12.'
|
193
|
+
end
|
194
|
+
|
195
|
+
pattern = Regexp.new(/^\+1(800|833|844|855|866|877|888)[2-9]\d{6}$/)
|
196
|
+
if phone_number !~ pattern
|
197
|
+
fail ArgumentError, "invalid value for \"phone_number\", must conform to the pattern #{pattern}."
|
270
198
|
end
|
271
199
|
|
272
|
-
@
|
200
|
+
@phone_number = phone_number
|
273
201
|
end
|
274
202
|
|
275
203
|
# Checks equality by comparing each attribute.
|
@@ -277,18 +205,14 @@ module Bandwidth
|
|
277
205
|
def ==(o)
|
278
206
|
return true if self.equal?(o)
|
279
207
|
self.class == o.class &&
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
text == o.text &&
|
289
|
-
tag == o.tag &&
|
290
|
-
media == o.media &&
|
291
|
-
priority == o.priority
|
208
|
+
phone_number == o.phone_number &&
|
209
|
+
status == o.status &&
|
210
|
+
internal_ticket_number == o.internal_ticket_number &&
|
211
|
+
decline_reason_description == o.decline_reason_description &&
|
212
|
+
resubmit_allowed == o.resubmit_allowed &&
|
213
|
+
created_date_time == o.created_date_time &&
|
214
|
+
modified_date_time == o.modified_date_time &&
|
215
|
+
submission == o.submission
|
292
216
|
end
|
293
217
|
|
294
218
|
# @see the `==` method
|
@@ -300,7 +224,7 @@ module Bandwidth
|
|
300
224
|
# Calculates hash code according to all attributes.
|
301
225
|
# @return [Integer] Hash code
|
302
226
|
def hash
|
303
|
-
[
|
227
|
+
[phone_number, status, internal_ticket_number, decline_reason_description, resubmit_allowed, created_date_time, modified_date_time, submission].hash
|
304
228
|
end
|
305
229
|
|
306
230
|
# Builds the object from hash
|
@@ -0,0 +1,43 @@
|
|
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 TfvStatusEnum
|
18
|
+
VERIFIED = 'VERIFIED'.freeze
|
19
|
+
UNVERIFIED = 'UNVERIFIED'.freeze
|
20
|
+
PENDING = 'PENDING'.freeze
|
21
|
+
PARTIALLY_VERIFIED = 'PARTIALLY_VERIFIED'.freeze
|
22
|
+
INVALID_STATUS = 'INVALID_STATUS'.freeze
|
23
|
+
|
24
|
+
def self.all_vars
|
25
|
+
@all_vars ||= [VERIFIED, UNVERIFIED, PENDING, PARTIALLY_VERIFIED, INVALID_STATUS].freeze
|
26
|
+
end
|
27
|
+
|
28
|
+
# Builds the enum from string
|
29
|
+
# @param [String] The enum value in the form of the string
|
30
|
+
# @return [String] The enum value
|
31
|
+
def self.build_from_hash(value)
|
32
|
+
new.build_from_hash(value)
|
33
|
+
end
|
34
|
+
|
35
|
+
# Builds the enum from string
|
36
|
+
# @param [String] The enum value in the form of the string
|
37
|
+
# @return [String] The enum value
|
38
|
+
def build_from_hash(value)
|
39
|
+
return value if TfvStatusEnum.all_vars.include?(value)
|
40
|
+
raise "Invalid ENUM value #{value} for class #TfvStatusEnum"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|