late-sdk 0.0.587 → 0.0.589
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/README.md +8 -0
- data/docs/PreflightSmsRegistration200Response.md +24 -0
- data/docs/PreflightSmsRegistration200ResponseAdvisoriesInner.md +24 -0
- data/docs/PreflightSmsRegistration200ResponseComposed.md +20 -0
- data/docs/PreflightSmsRegistrationRequest.md +26 -0
- data/docs/RespondToSmsRegistrationReview200Response.md +18 -0
- data/docs/RespondToSmsRegistrationReviewRequest.md +20 -0
- data/docs/SMSApi.md +142 -0
- data/docs/StartSmsRegistrationRequest.md +2 -0
- data/docs/WebhooksApi.md +2 -2
- data/lib/zernio-sdk/api/sms_api.rb +142 -0
- data/lib/zernio-sdk/api/webhooks_api.rb +4 -4
- data/lib/zernio-sdk/models/preflight_sms_registration200_response.rb +211 -0
- data/lib/zernio-sdk/models/preflight_sms_registration200_response_advisories_inner.rb +212 -0
- data/lib/zernio-sdk/models/preflight_sms_registration200_response_composed.rb +157 -0
- data/lib/zernio-sdk/models/preflight_sms_registration_request.rb +290 -0
- data/lib/zernio-sdk/models/respond_to_sms_registration_review200_response.rb +181 -0
- data/lib/zernio-sdk/models/respond_to_sms_registration_review_request.rb +198 -0
- data/lib/zernio-sdk/models/start_sms_registration_request.rb +39 -1
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +6 -0
- data/openapi.yaml +105 -2
- data/spec/api/sms_api_spec.rb +25 -0
- data/spec/api/webhooks_api_spec.rb +2 -2
- data/spec/models/preflight_sms_registration200_response_advisories_inner_spec.rb +58 -0
- data/spec/models/preflight_sms_registration200_response_composed_spec.rb +42 -0
- data/spec/models/preflight_sms_registration200_response_spec.rb +58 -0
- data/spec/models/preflight_sms_registration_request_spec.rb +64 -0
- data/spec/models/respond_to_sms_registration_review200_response_spec.rb +40 -0
- data/spec/models/respond_to_sms_registration_review_request_spec.rb +42 -0
- data/spec/models/start_sms_registration_request_spec.rb +6 -0
- data/zernio-sdk-0.0.589.gem +0 -0
- metadata +26 -2
- data/zernio-sdk-0.0.587.gem +0 -0
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Zernio
|
|
17
|
+
class PreflightSmsRegistrationRequest < ApiModelBase
|
|
18
|
+
attr_accessor :registration_type
|
|
19
|
+
|
|
20
|
+
attr_accessor :phone_numbers
|
|
21
|
+
|
|
22
|
+
# Same shape as the registration `brand`.
|
|
23
|
+
attr_accessor :brand
|
|
24
|
+
|
|
25
|
+
# Same shape as the registration `campaign`.
|
|
26
|
+
attr_accessor :campaign
|
|
27
|
+
|
|
28
|
+
attr_accessor :messaging_brand_name
|
|
29
|
+
|
|
30
|
+
class EnumAttributeValidator
|
|
31
|
+
attr_reader :datatype
|
|
32
|
+
attr_reader :allowable_values
|
|
33
|
+
|
|
34
|
+
def initialize(datatype, allowable_values)
|
|
35
|
+
@allowable_values = allowable_values.map do |value|
|
|
36
|
+
case datatype.to_s
|
|
37
|
+
when /Integer/i
|
|
38
|
+
value.to_i
|
|
39
|
+
when /Float/i
|
|
40
|
+
value.to_f
|
|
41
|
+
else
|
|
42
|
+
value
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def valid?(value)
|
|
48
|
+
!value || allowable_values.include?(value)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
53
|
+
def self.attribute_map
|
|
54
|
+
{
|
|
55
|
+
:'registration_type' => :'registrationType',
|
|
56
|
+
:'phone_numbers' => :'phoneNumbers',
|
|
57
|
+
:'brand' => :'brand',
|
|
58
|
+
:'campaign' => :'campaign',
|
|
59
|
+
:'messaging_brand_name' => :'messagingBrandName'
|
|
60
|
+
}
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Returns attribute mapping this model knows about
|
|
64
|
+
def self.acceptable_attribute_map
|
|
65
|
+
attribute_map
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Returns all the JSON keys this model knows about
|
|
69
|
+
def self.acceptable_attributes
|
|
70
|
+
acceptable_attribute_map.values
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Attribute type mapping.
|
|
74
|
+
def self.openapi_types
|
|
75
|
+
{
|
|
76
|
+
:'registration_type' => :'String',
|
|
77
|
+
:'phone_numbers' => :'Array<String>',
|
|
78
|
+
:'brand' => :'Object',
|
|
79
|
+
:'campaign' => :'Object',
|
|
80
|
+
:'messaging_brand_name' => :'String'
|
|
81
|
+
}
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# List of attributes with nullable: true
|
|
85
|
+
def self.openapi_nullable
|
|
86
|
+
Set.new([
|
|
87
|
+
])
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Initializes the object
|
|
91
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
92
|
+
def initialize(attributes = {})
|
|
93
|
+
if (!attributes.is_a?(Hash))
|
|
94
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::PreflightSmsRegistrationRequest` initialize method"
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
98
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
99
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
100
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
101
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::PreflightSmsRegistrationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
102
|
+
end
|
|
103
|
+
h[k.to_sym] = v
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if attributes.key?(:'registration_type')
|
|
107
|
+
self.registration_type = attributes[:'registration_type']
|
|
108
|
+
else
|
|
109
|
+
self.registration_type = nil
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if attributes.key?(:'phone_numbers')
|
|
113
|
+
if (value = attributes[:'phone_numbers']).is_a?(Array)
|
|
114
|
+
self.phone_numbers = value
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if attributes.key?(:'brand')
|
|
119
|
+
self.brand = attributes[:'brand']
|
|
120
|
+
else
|
|
121
|
+
self.brand = nil
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'campaign')
|
|
125
|
+
self.campaign = attributes[:'campaign']
|
|
126
|
+
else
|
|
127
|
+
self.campaign = nil
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if attributes.key?(:'messaging_brand_name')
|
|
131
|
+
self.messaging_brand_name = attributes[:'messaging_brand_name']
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
136
|
+
# @return Array for valid properties with the reasons
|
|
137
|
+
def list_invalid_properties
|
|
138
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
139
|
+
invalid_properties = Array.new
|
|
140
|
+
if @registration_type.nil?
|
|
141
|
+
invalid_properties.push('invalid value for "registration_type", registration_type cannot be nil.')
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if @brand.nil?
|
|
145
|
+
invalid_properties.push('invalid value for "brand", brand cannot be nil.')
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if @campaign.nil?
|
|
149
|
+
invalid_properties.push('invalid value for "campaign", campaign cannot be nil.')
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if !@messaging_brand_name.nil? && @messaging_brand_name.to_s.length > 60
|
|
153
|
+
invalid_properties.push('invalid value for "messaging_brand_name", the character length must be smaller than or equal to 60.')
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if !@messaging_brand_name.nil? && @messaging_brand_name.to_s.length < 2
|
|
157
|
+
invalid_properties.push('invalid value for "messaging_brand_name", the character length must be greater than or equal to 2.')
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
invalid_properties
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Check to see if the all the properties in the model are valid
|
|
164
|
+
# @return true if the model is valid
|
|
165
|
+
def valid?
|
|
166
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
167
|
+
return false if @registration_type.nil?
|
|
168
|
+
registration_type_validator = EnumAttributeValidator.new('String', ["standard_10dlc", "sole_prop_10dlc"])
|
|
169
|
+
return false unless registration_type_validator.valid?(@registration_type)
|
|
170
|
+
return false if @brand.nil?
|
|
171
|
+
return false if @campaign.nil?
|
|
172
|
+
return false if !@messaging_brand_name.nil? && @messaging_brand_name.to_s.length > 60
|
|
173
|
+
return false if !@messaging_brand_name.nil? && @messaging_brand_name.to_s.length < 2
|
|
174
|
+
true
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
178
|
+
# @param [Object] registration_type Object to be assigned
|
|
179
|
+
def registration_type=(registration_type)
|
|
180
|
+
validator = EnumAttributeValidator.new('String', ["standard_10dlc", "sole_prop_10dlc"])
|
|
181
|
+
unless validator.valid?(registration_type)
|
|
182
|
+
fail ArgumentError, "invalid value for \"registration_type\", must be one of #{validator.allowable_values}."
|
|
183
|
+
end
|
|
184
|
+
@registration_type = registration_type
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Custom attribute writer method with validation
|
|
188
|
+
# @param [Object] brand Value to be assigned
|
|
189
|
+
def brand=(brand)
|
|
190
|
+
if brand.nil?
|
|
191
|
+
fail ArgumentError, 'brand cannot be nil'
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
@brand = brand
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Custom attribute writer method with validation
|
|
198
|
+
# @param [Object] campaign Value to be assigned
|
|
199
|
+
def campaign=(campaign)
|
|
200
|
+
if campaign.nil?
|
|
201
|
+
fail ArgumentError, 'campaign cannot be nil'
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
@campaign = campaign
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Custom attribute writer method with validation
|
|
208
|
+
# @param [Object] messaging_brand_name Value to be assigned
|
|
209
|
+
def messaging_brand_name=(messaging_brand_name)
|
|
210
|
+
if messaging_brand_name.nil?
|
|
211
|
+
fail ArgumentError, 'messaging_brand_name cannot be nil'
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
if messaging_brand_name.to_s.length > 60
|
|
215
|
+
fail ArgumentError, 'invalid value for "messaging_brand_name", the character length must be smaller than or equal to 60.'
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
if messaging_brand_name.to_s.length < 2
|
|
219
|
+
fail ArgumentError, 'invalid value for "messaging_brand_name", the character length must be greater than or equal to 2.'
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
@messaging_brand_name = messaging_brand_name
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
# Checks equality by comparing each attribute.
|
|
226
|
+
# @param [Object] Object to be compared
|
|
227
|
+
def ==(o)
|
|
228
|
+
return true if self.equal?(o)
|
|
229
|
+
self.class == o.class &&
|
|
230
|
+
registration_type == o.registration_type &&
|
|
231
|
+
phone_numbers == o.phone_numbers &&
|
|
232
|
+
brand == o.brand &&
|
|
233
|
+
campaign == o.campaign &&
|
|
234
|
+
messaging_brand_name == o.messaging_brand_name
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
# @see the `==` method
|
|
238
|
+
# @param [Object] Object to be compared
|
|
239
|
+
def eql?(o)
|
|
240
|
+
self == o
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
# Calculates hash code according to all attributes.
|
|
244
|
+
# @return [Integer] Hash code
|
|
245
|
+
def hash
|
|
246
|
+
[registration_type, phone_numbers, brand, campaign, messaging_brand_name].hash
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
# Builds the object from hash
|
|
250
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
251
|
+
# @return [Object] Returns the model itself
|
|
252
|
+
def self.build_from_hash(attributes)
|
|
253
|
+
return nil unless attributes.is_a?(Hash)
|
|
254
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
255
|
+
transformed_hash = {}
|
|
256
|
+
openapi_types.each_pair do |key, type|
|
|
257
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
258
|
+
transformed_hash["#{key}"] = nil
|
|
259
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
260
|
+
# check to ensure the input is an array given that the attribute
|
|
261
|
+
# is documented as an array but the input is not
|
|
262
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
263
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
264
|
+
end
|
|
265
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
266
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
267
|
+
end
|
|
268
|
+
end
|
|
269
|
+
new(transformed_hash)
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
# Returns the object in the form of hash
|
|
273
|
+
# @return [Hash] Returns the object in the form of hash
|
|
274
|
+
def to_hash
|
|
275
|
+
hash = {}
|
|
276
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
277
|
+
value = self.send(attr)
|
|
278
|
+
if value.nil?
|
|
279
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
280
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
hash[param] = _to_hash(value)
|
|
284
|
+
end
|
|
285
|
+
hash
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
end
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Zernio
|
|
17
|
+
class RespondToSmsRegistrationReview200Response < ApiModelBase
|
|
18
|
+
attr_accessor :status
|
|
19
|
+
|
|
20
|
+
class EnumAttributeValidator
|
|
21
|
+
attr_reader :datatype
|
|
22
|
+
attr_reader :allowable_values
|
|
23
|
+
|
|
24
|
+
def initialize(datatype, allowable_values)
|
|
25
|
+
@allowable_values = allowable_values.map do |value|
|
|
26
|
+
case datatype.to_s
|
|
27
|
+
when /Integer/i
|
|
28
|
+
value.to_i
|
|
29
|
+
when /Float/i
|
|
30
|
+
value.to_f
|
|
31
|
+
else
|
|
32
|
+
value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def valid?(value)
|
|
38
|
+
!value || allowable_values.include?(value)
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
43
|
+
def self.attribute_map
|
|
44
|
+
{
|
|
45
|
+
:'status' => :'status'
|
|
46
|
+
}
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Returns attribute mapping this model knows about
|
|
50
|
+
def self.acceptable_attribute_map
|
|
51
|
+
attribute_map
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Returns all the JSON keys this model knows about
|
|
55
|
+
def self.acceptable_attributes
|
|
56
|
+
acceptable_attribute_map.values
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Attribute type mapping.
|
|
60
|
+
def self.openapi_types
|
|
61
|
+
{
|
|
62
|
+
:'status' => :'String'
|
|
63
|
+
}
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# List of attributes with nullable: true
|
|
67
|
+
def self.openapi_nullable
|
|
68
|
+
Set.new([
|
|
69
|
+
])
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Initializes the object
|
|
73
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
74
|
+
def initialize(attributes = {})
|
|
75
|
+
if (!attributes.is_a?(Hash))
|
|
76
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::RespondToSmsRegistrationReview200Response` initialize method"
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
80
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
81
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
82
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
83
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::RespondToSmsRegistrationReview200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
84
|
+
end
|
|
85
|
+
h[k.to_sym] = v
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'status')
|
|
89
|
+
self.status = attributes[:'status']
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
94
|
+
# @return Array for valid properties with the reasons
|
|
95
|
+
def list_invalid_properties
|
|
96
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
97
|
+
invalid_properties = Array.new
|
|
98
|
+
invalid_properties
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Check to see if the all the properties in the model are valid
|
|
102
|
+
# @return true if the model is valid
|
|
103
|
+
def valid?
|
|
104
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
105
|
+
status_validator = EnumAttributeValidator.new('String', ["requested"])
|
|
106
|
+
return false unless status_validator.valid?(@status)
|
|
107
|
+
true
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
111
|
+
# @param [Object] status Object to be assigned
|
|
112
|
+
def status=(status)
|
|
113
|
+
validator = EnumAttributeValidator.new('String', ["requested"])
|
|
114
|
+
unless validator.valid?(status)
|
|
115
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
|
116
|
+
end
|
|
117
|
+
@status = status
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Checks equality by comparing each attribute.
|
|
121
|
+
# @param [Object] Object to be compared
|
|
122
|
+
def ==(o)
|
|
123
|
+
return true if self.equal?(o)
|
|
124
|
+
self.class == o.class &&
|
|
125
|
+
status == o.status
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# @see the `==` method
|
|
129
|
+
# @param [Object] Object to be compared
|
|
130
|
+
def eql?(o)
|
|
131
|
+
self == o
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Calculates hash code according to all attributes.
|
|
135
|
+
# @return [Integer] Hash code
|
|
136
|
+
def hash
|
|
137
|
+
[status].hash
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Builds the object from hash
|
|
141
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
142
|
+
# @return [Object] Returns the model itself
|
|
143
|
+
def self.build_from_hash(attributes)
|
|
144
|
+
return nil unless attributes.is_a?(Hash)
|
|
145
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
146
|
+
transformed_hash = {}
|
|
147
|
+
openapi_types.each_pair do |key, type|
|
|
148
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
149
|
+
transformed_hash["#{key}"] = nil
|
|
150
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
151
|
+
# check to ensure the input is an array given that the attribute
|
|
152
|
+
# is documented as an array but the input is not
|
|
153
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
154
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
155
|
+
end
|
|
156
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
157
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
new(transformed_hash)
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Returns the object in the form of hash
|
|
164
|
+
# @return [Hash] Returns the object in the form of hash
|
|
165
|
+
def to_hash
|
|
166
|
+
hash = {}
|
|
167
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
168
|
+
value = self.send(attr)
|
|
169
|
+
if value.nil?
|
|
170
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
171
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
hash[param] = _to_hash(value)
|
|
175
|
+
end
|
|
176
|
+
hash
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
end
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Zernio
|
|
17
|
+
class RespondToSmsRegistrationReviewRequest < ApiModelBase
|
|
18
|
+
# Answer for the reviewer. Required when no files are sent.
|
|
19
|
+
attr_accessor :note
|
|
20
|
+
|
|
21
|
+
# Hosted document URLs returned by POST /v1/sms/opt-in-proof.
|
|
22
|
+
attr_accessor :files
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'note' => :'note',
|
|
28
|
+
:'files' => :'files'
|
|
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
|
+
:'note' => :'String',
|
|
46
|
+
:'files' => :'Array<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 `Zernio::RespondToSmsRegistrationReviewRequest` 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 `Zernio::RespondToSmsRegistrationReviewRequest`. 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?(:'note')
|
|
73
|
+
self.note = attributes[:'note']
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
if attributes.key?(:'files')
|
|
77
|
+
if (value = attributes[:'files']).is_a?(Array)
|
|
78
|
+
self.files = value
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
84
|
+
# @return Array for valid properties with the reasons
|
|
85
|
+
def list_invalid_properties
|
|
86
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
87
|
+
invalid_properties = Array.new
|
|
88
|
+
if !@note.nil? && @note.to_s.length > 2000
|
|
89
|
+
invalid_properties.push('invalid value for "note", the character length must be smaller than or equal to 2000.')
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if !@files.nil? && @files.length > 5
|
|
93
|
+
invalid_properties.push('invalid value for "files", number of items must be less than or equal to 5.')
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
invalid_properties
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Check to see if the all the properties in the model are valid
|
|
100
|
+
# @return true if the model is valid
|
|
101
|
+
def valid?
|
|
102
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
103
|
+
return false if !@note.nil? && @note.to_s.length > 2000
|
|
104
|
+
return false if !@files.nil? && @files.length > 5
|
|
105
|
+
true
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Custom attribute writer method with validation
|
|
109
|
+
# @param [Object] note Value to be assigned
|
|
110
|
+
def note=(note)
|
|
111
|
+
if note.nil?
|
|
112
|
+
fail ArgumentError, 'note cannot be nil'
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if note.to_s.length > 2000
|
|
116
|
+
fail ArgumentError, 'invalid value for "note", the character length must be smaller than or equal to 2000.'
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
@note = note
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# Custom attribute writer method with validation
|
|
123
|
+
# @param [Object] files Value to be assigned
|
|
124
|
+
def files=(files)
|
|
125
|
+
if files.nil?
|
|
126
|
+
fail ArgumentError, 'files cannot be nil'
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
if files.length > 5
|
|
130
|
+
fail ArgumentError, 'invalid value for "files", number of items must be less than or equal to 5.'
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
@files = files
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Checks equality by comparing each attribute.
|
|
137
|
+
# @param [Object] Object to be compared
|
|
138
|
+
def ==(o)
|
|
139
|
+
return true if self.equal?(o)
|
|
140
|
+
self.class == o.class &&
|
|
141
|
+
note == o.note &&
|
|
142
|
+
files == o.files
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# @see the `==` method
|
|
146
|
+
# @param [Object] Object to be compared
|
|
147
|
+
def eql?(o)
|
|
148
|
+
self == o
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Calculates hash code according to all attributes.
|
|
152
|
+
# @return [Integer] Hash code
|
|
153
|
+
def hash
|
|
154
|
+
[note, files].hash
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Builds the object from hash
|
|
158
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
159
|
+
# @return [Object] Returns the model itself
|
|
160
|
+
def self.build_from_hash(attributes)
|
|
161
|
+
return nil unless attributes.is_a?(Hash)
|
|
162
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
163
|
+
transformed_hash = {}
|
|
164
|
+
openapi_types.each_pair do |key, type|
|
|
165
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
166
|
+
transformed_hash["#{key}"] = nil
|
|
167
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
168
|
+
# check to ensure the input is an array given that the attribute
|
|
169
|
+
# is documented as an array but the input is not
|
|
170
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
171
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
172
|
+
end
|
|
173
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
174
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
175
|
+
end
|
|
176
|
+
end
|
|
177
|
+
new(transformed_hash)
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# Returns the object in the form of hash
|
|
181
|
+
# @return [Hash] Returns the object in the form of hash
|
|
182
|
+
def to_hash
|
|
183
|
+
hash = {}
|
|
184
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
185
|
+
value = self.send(attr)
|
|
186
|
+
if value.nil?
|
|
187
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
188
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
hash[param] = _to_hash(value)
|
|
192
|
+
end
|
|
193
|
+
hash
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
end
|