zernio-sdk 0.0.538 → 0.0.539
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 +11 -0
- data/docs/CheckVerification200Response.md +40 -0
- data/docs/CheckVerificationRequest.md +18 -0
- data/docs/CreateVerificationRequest.md +28 -0
- data/docs/OnVerificationApprovedRequest.md +24 -0
- data/docs/OnVerificationApprovedRequestVerification.md +22 -0
- data/docs/OnVerificationFailedRequest.md +26 -0
- data/docs/OnVerificationFailedRequestVerification.md +22 -0
- data/docs/Verification.md +38 -0
- data/docs/VerifyApi.md +219 -0
- data/docs/WebhookEventsApi.md +138 -0
- data/lib/zernio-sdk/api/verify_api.rb +227 -0
- data/lib/zernio-sdk/api/webhook_events_api.rb +132 -0
- data/lib/zernio-sdk/models/check_verification200_response.rb +301 -0
- data/lib/zernio-sdk/models/check_verification_request.rb +175 -0
- data/lib/zernio-sdk/models/create_verification_request.rb +333 -0
- data/lib/zernio-sdk/models/on_verification_approved_request.rb +208 -0
- data/lib/zernio-sdk/models/on_verification_approved_request_verification.rb +199 -0
- data/lib/zernio-sdk/models/on_verification_failed_request.rb +229 -0
- data/lib/zernio-sdk/models/on_verification_failed_request_verification.rb +199 -0
- data/lib/zernio-sdk/models/on_whats_app_number_kyc_submitted_request.rb +2 -2
- data/lib/zernio-sdk/models/verification.rb +287 -0
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +9 -0
- data/openapi.yaml +205 -5
- data/spec/api/verify_api_spec.rb +72 -0
- data/spec/models/check_verification200_response_spec.rb +110 -0
- data/spec/models/check_verification_request_spec.rb +36 -0
- data/spec/models/create_verification_request_spec.rb +70 -0
- data/spec/models/create_webhook_settings_request_spec.rb +1 -1
- data/spec/models/on_verification_approved_request_spec.rb +58 -0
- data/spec/models/on_verification_approved_request_verification_spec.rb +52 -0
- data/spec/models/on_verification_failed_request_spec.rb +68 -0
- data/spec/models/on_verification_failed_request_verification_spec.rb +52 -0
- data/spec/models/on_whats_app_number_kyc_submitted_request_spec.rb +1 -1
- data/spec/models/update_webhook_settings_request_spec.rb +1 -1
- data/spec/models/verification_spec.rb +104 -0
- data/spec/models/webhook_spec.rb +1 -1
- metadata +37 -1
|
@@ -0,0 +1,175 @@
|
|
|
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 CheckVerificationRequest < ApiModelBase
|
|
18
|
+
attr_accessor :code
|
|
19
|
+
|
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
|
+
def self.attribute_map
|
|
22
|
+
{
|
|
23
|
+
:'code' => :'code'
|
|
24
|
+
}
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Returns attribute mapping this model knows about
|
|
28
|
+
def self.acceptable_attribute_map
|
|
29
|
+
attribute_map
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns all the JSON keys this model knows about
|
|
33
|
+
def self.acceptable_attributes
|
|
34
|
+
acceptable_attribute_map.values
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Attribute type mapping.
|
|
38
|
+
def self.openapi_types
|
|
39
|
+
{
|
|
40
|
+
:'code' => :'String'
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# List of attributes with nullable: true
|
|
45
|
+
def self.openapi_nullable
|
|
46
|
+
Set.new([
|
|
47
|
+
])
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Initializes the object
|
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
52
|
+
def initialize(attributes = {})
|
|
53
|
+
if (!attributes.is_a?(Hash))
|
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CheckVerificationRequest` initialize method"
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
58
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
60
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::CheckVerificationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
62
|
+
end
|
|
63
|
+
h[k.to_sym] = v
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if attributes.key?(:'code')
|
|
67
|
+
self.code = attributes[:'code']
|
|
68
|
+
else
|
|
69
|
+
self.code = nil
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
74
|
+
# @return Array for valid properties with the reasons
|
|
75
|
+
def list_invalid_properties
|
|
76
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
77
|
+
invalid_properties = Array.new
|
|
78
|
+
if @code.nil?
|
|
79
|
+
invalid_properties.push('invalid value for "code", code cannot be nil.')
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
pattern = Regexp.new(/^\d{4,8}$/)
|
|
83
|
+
if @code !~ pattern
|
|
84
|
+
invalid_properties.push("invalid value for \"code\", must conform to the pattern #{pattern}.")
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
invalid_properties
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Check to see if the all the properties in the model are valid
|
|
91
|
+
# @return true if the model is valid
|
|
92
|
+
def valid?
|
|
93
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
94
|
+
return false if @code.nil?
|
|
95
|
+
return false if @code !~ Regexp.new(/^\d{4,8}$/)
|
|
96
|
+
true
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Custom attribute writer method with validation
|
|
100
|
+
# @param [Object] code Value to be assigned
|
|
101
|
+
def code=(code)
|
|
102
|
+
if code.nil?
|
|
103
|
+
fail ArgumentError, 'code cannot be nil'
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
pattern = Regexp.new(/^\d{4,8}$/)
|
|
107
|
+
if code !~ pattern
|
|
108
|
+
fail ArgumentError, "invalid value for \"code\", must conform to the pattern #{pattern}."
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
@code = code
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# Checks equality by comparing each attribute.
|
|
115
|
+
# @param [Object] Object to be compared
|
|
116
|
+
def ==(o)
|
|
117
|
+
return true if self.equal?(o)
|
|
118
|
+
self.class == o.class &&
|
|
119
|
+
code == o.code
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# @see the `==` method
|
|
123
|
+
# @param [Object] Object to be compared
|
|
124
|
+
def eql?(o)
|
|
125
|
+
self == o
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Calculates hash code according to all attributes.
|
|
129
|
+
# @return [Integer] Hash code
|
|
130
|
+
def hash
|
|
131
|
+
[code].hash
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Builds the object from hash
|
|
135
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
136
|
+
# @return [Object] Returns the model itself
|
|
137
|
+
def self.build_from_hash(attributes)
|
|
138
|
+
return nil unless attributes.is_a?(Hash)
|
|
139
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
140
|
+
transformed_hash = {}
|
|
141
|
+
openapi_types.each_pair do |key, type|
|
|
142
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
143
|
+
transformed_hash["#{key}"] = nil
|
|
144
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
145
|
+
# check to ensure the input is an array given that the attribute
|
|
146
|
+
# is documented as an array but the input is not
|
|
147
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
148
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
149
|
+
end
|
|
150
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
151
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
new(transformed_hash)
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Returns the object in the form of hash
|
|
158
|
+
# @return [Hash] Returns the object in the form of hash
|
|
159
|
+
def to_hash
|
|
160
|
+
hash = {}
|
|
161
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
162
|
+
value = self.send(attr)
|
|
163
|
+
if value.nil?
|
|
164
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
165
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
hash[param] = _to_hash(value)
|
|
169
|
+
end
|
|
170
|
+
hash
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
end
|
|
@@ -0,0 +1,333 @@
|
|
|
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 CreateVerificationRequest < ApiModelBase
|
|
18
|
+
# SMS-only for now.
|
|
19
|
+
attr_accessor :channel
|
|
20
|
+
|
|
21
|
+
# E.164 phone number.
|
|
22
|
+
attr_accessor :to
|
|
23
|
+
|
|
24
|
+
# The SMS-enabled number on your account to send from. Defaults to your only SMS number.
|
|
25
|
+
attr_accessor :from
|
|
26
|
+
|
|
27
|
+
# Your app or business name, rendered in the message. Defaults to your account name. Letters, numbers, and basic punctuation only.
|
|
28
|
+
attr_accessor :brand_name
|
|
29
|
+
|
|
30
|
+
attr_accessor :code_length
|
|
31
|
+
|
|
32
|
+
attr_accessor :ttl_minutes
|
|
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
|
+
:'channel' => :'channel',
|
|
60
|
+
:'to' => :'to',
|
|
61
|
+
:'from' => :'from',
|
|
62
|
+
:'brand_name' => :'brandName',
|
|
63
|
+
:'code_length' => :'codeLength',
|
|
64
|
+
:'ttl_minutes' => :'ttlMinutes'
|
|
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
|
+
:'channel' => :'String',
|
|
82
|
+
:'to' => :'String',
|
|
83
|
+
:'from' => :'String',
|
|
84
|
+
:'brand_name' => :'String',
|
|
85
|
+
:'code_length' => :'Integer',
|
|
86
|
+
:'ttl_minutes' => :'Integer'
|
|
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 `Zernio::CreateVerificationRequest` 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 `Zernio::CreateVerificationRequest`. 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?(:'channel')
|
|
113
|
+
self.channel = attributes[:'channel']
|
|
114
|
+
else
|
|
115
|
+
self.channel = nil
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if attributes.key?(:'to')
|
|
119
|
+
self.to = attributes[:'to']
|
|
120
|
+
else
|
|
121
|
+
self.to = nil
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'from')
|
|
125
|
+
self.from = attributes[:'from']
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if attributes.key?(:'brand_name')
|
|
129
|
+
self.brand_name = attributes[:'brand_name']
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'code_length')
|
|
133
|
+
self.code_length = attributes[:'code_length']
|
|
134
|
+
else
|
|
135
|
+
self.code_length = 6
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if attributes.key?(:'ttl_minutes')
|
|
139
|
+
self.ttl_minutes = attributes[:'ttl_minutes']
|
|
140
|
+
else
|
|
141
|
+
self.ttl_minutes = 10
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
146
|
+
# @return Array for valid properties with the reasons
|
|
147
|
+
def list_invalid_properties
|
|
148
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
149
|
+
invalid_properties = Array.new
|
|
150
|
+
if @channel.nil?
|
|
151
|
+
invalid_properties.push('invalid value for "channel", channel cannot be nil.')
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
if @to.nil?
|
|
155
|
+
invalid_properties.push('invalid value for "to", to cannot be nil.')
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
if !@brand_name.nil? && @brand_name.to_s.length > 30
|
|
159
|
+
invalid_properties.push('invalid value for "brand_name", the character length must be smaller than or equal to 30.')
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
if !@code_length.nil? && @code_length > 8
|
|
163
|
+
invalid_properties.push('invalid value for "code_length", must be smaller than or equal to 8.')
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
if !@code_length.nil? && @code_length < 4
|
|
167
|
+
invalid_properties.push('invalid value for "code_length", must be greater than or equal to 4.')
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
if !@ttl_minutes.nil? && @ttl_minutes > 15
|
|
171
|
+
invalid_properties.push('invalid value for "ttl_minutes", must be smaller than or equal to 15.')
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
if !@ttl_minutes.nil? && @ttl_minutes < 1
|
|
175
|
+
invalid_properties.push('invalid value for "ttl_minutes", must be greater than or equal to 1.')
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
invalid_properties
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Check to see if the all the properties in the model are valid
|
|
182
|
+
# @return true if the model is valid
|
|
183
|
+
def valid?
|
|
184
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
185
|
+
return false if @channel.nil?
|
|
186
|
+
channel_validator = EnumAttributeValidator.new('String', ["sms"])
|
|
187
|
+
return false unless channel_validator.valid?(@channel)
|
|
188
|
+
return false if @to.nil?
|
|
189
|
+
return false if !@brand_name.nil? && @brand_name.to_s.length > 30
|
|
190
|
+
return false if !@code_length.nil? && @code_length > 8
|
|
191
|
+
return false if !@code_length.nil? && @code_length < 4
|
|
192
|
+
return false if !@ttl_minutes.nil? && @ttl_minutes > 15
|
|
193
|
+
return false if !@ttl_minutes.nil? && @ttl_minutes < 1
|
|
194
|
+
true
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
198
|
+
# @param [Object] channel Object to be assigned
|
|
199
|
+
def channel=(channel)
|
|
200
|
+
validator = EnumAttributeValidator.new('String', ["sms"])
|
|
201
|
+
unless validator.valid?(channel)
|
|
202
|
+
fail ArgumentError, "invalid value for \"channel\", must be one of #{validator.allowable_values}."
|
|
203
|
+
end
|
|
204
|
+
@channel = channel
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Custom attribute writer method with validation
|
|
208
|
+
# @param [Object] to Value to be assigned
|
|
209
|
+
def to=(to)
|
|
210
|
+
if to.nil?
|
|
211
|
+
fail ArgumentError, 'to cannot be nil'
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
@to = to
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Custom attribute writer method with validation
|
|
218
|
+
# @param [Object] brand_name Value to be assigned
|
|
219
|
+
def brand_name=(brand_name)
|
|
220
|
+
if brand_name.nil?
|
|
221
|
+
fail ArgumentError, 'brand_name cannot be nil'
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
if brand_name.to_s.length > 30
|
|
225
|
+
fail ArgumentError, 'invalid value for "brand_name", the character length must be smaller than or equal to 30.'
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
@brand_name = brand_name
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# Custom attribute writer method with validation
|
|
232
|
+
# @param [Object] code_length Value to be assigned
|
|
233
|
+
def code_length=(code_length)
|
|
234
|
+
if code_length.nil?
|
|
235
|
+
fail ArgumentError, 'code_length cannot be nil'
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
if code_length > 8
|
|
239
|
+
fail ArgumentError, 'invalid value for "code_length", must be smaller than or equal to 8.'
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
if code_length < 4
|
|
243
|
+
fail ArgumentError, 'invalid value for "code_length", must be greater than or equal to 4.'
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
@code_length = code_length
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
# Custom attribute writer method with validation
|
|
250
|
+
# @param [Object] ttl_minutes Value to be assigned
|
|
251
|
+
def ttl_minutes=(ttl_minutes)
|
|
252
|
+
if ttl_minutes.nil?
|
|
253
|
+
fail ArgumentError, 'ttl_minutes cannot be nil'
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
if ttl_minutes > 15
|
|
257
|
+
fail ArgumentError, 'invalid value for "ttl_minutes", must be smaller than or equal to 15.'
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
if ttl_minutes < 1
|
|
261
|
+
fail ArgumentError, 'invalid value for "ttl_minutes", must be greater than or equal to 1.'
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
@ttl_minutes = ttl_minutes
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
# Checks equality by comparing each attribute.
|
|
268
|
+
# @param [Object] Object to be compared
|
|
269
|
+
def ==(o)
|
|
270
|
+
return true if self.equal?(o)
|
|
271
|
+
self.class == o.class &&
|
|
272
|
+
channel == o.channel &&
|
|
273
|
+
to == o.to &&
|
|
274
|
+
from == o.from &&
|
|
275
|
+
brand_name == o.brand_name &&
|
|
276
|
+
code_length == o.code_length &&
|
|
277
|
+
ttl_minutes == o.ttl_minutes
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
# @see the `==` method
|
|
281
|
+
# @param [Object] Object to be compared
|
|
282
|
+
def eql?(o)
|
|
283
|
+
self == o
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
# Calculates hash code according to all attributes.
|
|
287
|
+
# @return [Integer] Hash code
|
|
288
|
+
def hash
|
|
289
|
+
[channel, to, from, brand_name, code_length, ttl_minutes].hash
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
# Builds the object from hash
|
|
293
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
294
|
+
# @return [Object] Returns the model itself
|
|
295
|
+
def self.build_from_hash(attributes)
|
|
296
|
+
return nil unless attributes.is_a?(Hash)
|
|
297
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
298
|
+
transformed_hash = {}
|
|
299
|
+
openapi_types.each_pair do |key, type|
|
|
300
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
301
|
+
transformed_hash["#{key}"] = nil
|
|
302
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
303
|
+
# check to ensure the input is an array given that the attribute
|
|
304
|
+
# is documented as an array but the input is not
|
|
305
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
306
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
307
|
+
end
|
|
308
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
309
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
310
|
+
end
|
|
311
|
+
end
|
|
312
|
+
new(transformed_hash)
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
# Returns the object in the form of hash
|
|
316
|
+
# @return [Hash] Returns the object in the form of hash
|
|
317
|
+
def to_hash
|
|
318
|
+
hash = {}
|
|
319
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
320
|
+
value = self.send(attr)
|
|
321
|
+
if value.nil?
|
|
322
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
323
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
hash[param] = _to_hash(value)
|
|
327
|
+
end
|
|
328
|
+
hash
|
|
329
|
+
end
|
|
330
|
+
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
end
|
|
@@ -0,0 +1,208 @@
|
|
|
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 OnVerificationApprovedRequest < ApiModelBase
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
attr_accessor :event
|
|
21
|
+
|
|
22
|
+
attr_accessor :timestamp
|
|
23
|
+
|
|
24
|
+
attr_accessor :verification
|
|
25
|
+
|
|
26
|
+
class EnumAttributeValidator
|
|
27
|
+
attr_reader :datatype
|
|
28
|
+
attr_reader :allowable_values
|
|
29
|
+
|
|
30
|
+
def initialize(datatype, allowable_values)
|
|
31
|
+
@allowable_values = allowable_values.map do |value|
|
|
32
|
+
case datatype.to_s
|
|
33
|
+
when /Integer/i
|
|
34
|
+
value.to_i
|
|
35
|
+
when /Float/i
|
|
36
|
+
value.to_f
|
|
37
|
+
else
|
|
38
|
+
value
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def valid?(value)
|
|
44
|
+
!value || allowable_values.include?(value)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
49
|
+
def self.attribute_map
|
|
50
|
+
{
|
|
51
|
+
:'id' => :'id',
|
|
52
|
+
:'event' => :'event',
|
|
53
|
+
:'timestamp' => :'timestamp',
|
|
54
|
+
:'verification' => :'verification'
|
|
55
|
+
}
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Returns attribute mapping this model knows about
|
|
59
|
+
def self.acceptable_attribute_map
|
|
60
|
+
attribute_map
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Returns all the JSON keys this model knows about
|
|
64
|
+
def self.acceptable_attributes
|
|
65
|
+
acceptable_attribute_map.values
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Attribute type mapping.
|
|
69
|
+
def self.openapi_types
|
|
70
|
+
{
|
|
71
|
+
:'id' => :'String',
|
|
72
|
+
:'event' => :'String',
|
|
73
|
+
:'timestamp' => :'Time',
|
|
74
|
+
:'verification' => :'OnVerificationApprovedRequestVerification'
|
|
75
|
+
}
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# List of attributes with nullable: true
|
|
79
|
+
def self.openapi_nullable
|
|
80
|
+
Set.new([
|
|
81
|
+
])
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Initializes the object
|
|
85
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
86
|
+
def initialize(attributes = {})
|
|
87
|
+
if (!attributes.is_a?(Hash))
|
|
88
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::OnVerificationApprovedRequest` initialize method"
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
92
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
93
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
94
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
95
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::OnVerificationApprovedRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
96
|
+
end
|
|
97
|
+
h[k.to_sym] = v
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if attributes.key?(:'id')
|
|
101
|
+
self.id = attributes[:'id']
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if attributes.key?(:'event')
|
|
105
|
+
self.event = attributes[:'event']
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'timestamp')
|
|
109
|
+
self.timestamp = attributes[:'timestamp']
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if attributes.key?(:'verification')
|
|
113
|
+
self.verification = attributes[:'verification']
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
118
|
+
# @return Array for valid properties with the reasons
|
|
119
|
+
def list_invalid_properties
|
|
120
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
121
|
+
invalid_properties = Array.new
|
|
122
|
+
invalid_properties
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Check to see if the all the properties in the model are valid
|
|
126
|
+
# @return true if the model is valid
|
|
127
|
+
def valid?
|
|
128
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
129
|
+
event_validator = EnumAttributeValidator.new('String', ["verification.approved"])
|
|
130
|
+
return false unless event_validator.valid?(@event)
|
|
131
|
+
true
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
135
|
+
# @param [Object] event Object to be assigned
|
|
136
|
+
def event=(event)
|
|
137
|
+
validator = EnumAttributeValidator.new('String', ["verification.approved"])
|
|
138
|
+
unless validator.valid?(event)
|
|
139
|
+
fail ArgumentError, "invalid value for \"event\", must be one of #{validator.allowable_values}."
|
|
140
|
+
end
|
|
141
|
+
@event = event
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Checks equality by comparing each attribute.
|
|
145
|
+
# @param [Object] Object to be compared
|
|
146
|
+
def ==(o)
|
|
147
|
+
return true if self.equal?(o)
|
|
148
|
+
self.class == o.class &&
|
|
149
|
+
id == o.id &&
|
|
150
|
+
event == o.event &&
|
|
151
|
+
timestamp == o.timestamp &&
|
|
152
|
+
verification == o.verification
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# @see the `==` method
|
|
156
|
+
# @param [Object] Object to be compared
|
|
157
|
+
def eql?(o)
|
|
158
|
+
self == o
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Calculates hash code according to all attributes.
|
|
162
|
+
# @return [Integer] Hash code
|
|
163
|
+
def hash
|
|
164
|
+
[id, event, timestamp, verification].hash
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Builds the object from hash
|
|
168
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
169
|
+
# @return [Object] Returns the model itself
|
|
170
|
+
def self.build_from_hash(attributes)
|
|
171
|
+
return nil unless attributes.is_a?(Hash)
|
|
172
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
173
|
+
transformed_hash = {}
|
|
174
|
+
openapi_types.each_pair do |key, type|
|
|
175
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
176
|
+
transformed_hash["#{key}"] = nil
|
|
177
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
178
|
+
# check to ensure the input is an array given that the attribute
|
|
179
|
+
# is documented as an array but the input is not
|
|
180
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
181
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
182
|
+
end
|
|
183
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
184
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
185
|
+
end
|
|
186
|
+
end
|
|
187
|
+
new(transformed_hash)
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Returns the object in the form of hash
|
|
191
|
+
# @return [Hash] Returns the object in the form of hash
|
|
192
|
+
def to_hash
|
|
193
|
+
hash = {}
|
|
194
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
195
|
+
value = self.send(attr)
|
|
196
|
+
if value.nil?
|
|
197
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
198
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
hash[param] = _to_hash(value)
|
|
202
|
+
end
|
|
203
|
+
hash
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
end
|