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,199 @@
|
|
|
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 OnVerificationApprovedRequestVerification < ApiModelBase
|
|
18
|
+
attr_accessor :verification_id
|
|
19
|
+
|
|
20
|
+
attr_accessor :channel
|
|
21
|
+
|
|
22
|
+
attr_accessor :to
|
|
23
|
+
|
|
24
|
+
class EnumAttributeValidator
|
|
25
|
+
attr_reader :datatype
|
|
26
|
+
attr_reader :allowable_values
|
|
27
|
+
|
|
28
|
+
def initialize(datatype, allowable_values)
|
|
29
|
+
@allowable_values = allowable_values.map do |value|
|
|
30
|
+
case datatype.to_s
|
|
31
|
+
when /Integer/i
|
|
32
|
+
value.to_i
|
|
33
|
+
when /Float/i
|
|
34
|
+
value.to_f
|
|
35
|
+
else
|
|
36
|
+
value
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def valid?(value)
|
|
42
|
+
!value || allowable_values.include?(value)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
47
|
+
def self.attribute_map
|
|
48
|
+
{
|
|
49
|
+
:'verification_id' => :'verificationId',
|
|
50
|
+
:'channel' => :'channel',
|
|
51
|
+
:'to' => :'to'
|
|
52
|
+
}
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Returns attribute mapping this model knows about
|
|
56
|
+
def self.acceptable_attribute_map
|
|
57
|
+
attribute_map
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Returns all the JSON keys this model knows about
|
|
61
|
+
def self.acceptable_attributes
|
|
62
|
+
acceptable_attribute_map.values
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Attribute type mapping.
|
|
66
|
+
def self.openapi_types
|
|
67
|
+
{
|
|
68
|
+
:'verification_id' => :'String',
|
|
69
|
+
:'channel' => :'String',
|
|
70
|
+
:'to' => :'String'
|
|
71
|
+
}
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# List of attributes with nullable: true
|
|
75
|
+
def self.openapi_nullable
|
|
76
|
+
Set.new([
|
|
77
|
+
])
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Initializes the object
|
|
81
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
82
|
+
def initialize(attributes = {})
|
|
83
|
+
if (!attributes.is_a?(Hash))
|
|
84
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::OnVerificationApprovedRequestVerification` initialize method"
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
88
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
89
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
90
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
91
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::OnVerificationApprovedRequestVerification`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
92
|
+
end
|
|
93
|
+
h[k.to_sym] = v
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if attributes.key?(:'verification_id')
|
|
97
|
+
self.verification_id = attributes[:'verification_id']
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if attributes.key?(:'channel')
|
|
101
|
+
self.channel = attributes[:'channel']
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if attributes.key?(:'to')
|
|
105
|
+
self.to = attributes[:'to']
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
110
|
+
# @return Array for valid properties with the reasons
|
|
111
|
+
def list_invalid_properties
|
|
112
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
113
|
+
invalid_properties = Array.new
|
|
114
|
+
invalid_properties
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Check to see if the all the properties in the model are valid
|
|
118
|
+
# @return true if the model is valid
|
|
119
|
+
def valid?
|
|
120
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
121
|
+
channel_validator = EnumAttributeValidator.new('String', ["sms"])
|
|
122
|
+
return false unless channel_validator.valid?(@channel)
|
|
123
|
+
true
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
127
|
+
# @param [Object] channel Object to be assigned
|
|
128
|
+
def channel=(channel)
|
|
129
|
+
validator = EnumAttributeValidator.new('String', ["sms"])
|
|
130
|
+
unless validator.valid?(channel)
|
|
131
|
+
fail ArgumentError, "invalid value for \"channel\", must be one of #{validator.allowable_values}."
|
|
132
|
+
end
|
|
133
|
+
@channel = channel
|
|
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
|
+
verification_id == o.verification_id &&
|
|
142
|
+
channel == o.channel &&
|
|
143
|
+
to == o.to
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# @see the `==` method
|
|
147
|
+
# @param [Object] Object to be compared
|
|
148
|
+
def eql?(o)
|
|
149
|
+
self == o
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Calculates hash code according to all attributes.
|
|
153
|
+
# @return [Integer] Hash code
|
|
154
|
+
def hash
|
|
155
|
+
[verification_id, channel, to].hash
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Builds the object from hash
|
|
159
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
160
|
+
# @return [Object] Returns the model itself
|
|
161
|
+
def self.build_from_hash(attributes)
|
|
162
|
+
return nil unless attributes.is_a?(Hash)
|
|
163
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
164
|
+
transformed_hash = {}
|
|
165
|
+
openapi_types.each_pair do |key, type|
|
|
166
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
167
|
+
transformed_hash["#{key}"] = nil
|
|
168
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
169
|
+
# check to ensure the input is an array given that the attribute
|
|
170
|
+
# is documented as an array but the input is not
|
|
171
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
172
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
173
|
+
end
|
|
174
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
175
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
new(transformed_hash)
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Returns the object in the form of hash
|
|
182
|
+
# @return [Hash] Returns the object in the form of hash
|
|
183
|
+
def to_hash
|
|
184
|
+
hash = {}
|
|
185
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
186
|
+
value = self.send(attr)
|
|
187
|
+
if value.nil?
|
|
188
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
189
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
hash[param] = _to_hash(value)
|
|
193
|
+
end
|
|
194
|
+
hash
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
end
|
|
@@ -0,0 +1,229 @@
|
|
|
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 OnVerificationFailedRequest < ApiModelBase
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
attr_accessor :event
|
|
21
|
+
|
|
22
|
+
attr_accessor :timestamp
|
|
23
|
+
|
|
24
|
+
attr_accessor :verification
|
|
25
|
+
|
|
26
|
+
attr_accessor :reason
|
|
27
|
+
|
|
28
|
+
class EnumAttributeValidator
|
|
29
|
+
attr_reader :datatype
|
|
30
|
+
attr_reader :allowable_values
|
|
31
|
+
|
|
32
|
+
def initialize(datatype, allowable_values)
|
|
33
|
+
@allowable_values = allowable_values.map do |value|
|
|
34
|
+
case datatype.to_s
|
|
35
|
+
when /Integer/i
|
|
36
|
+
value.to_i
|
|
37
|
+
when /Float/i
|
|
38
|
+
value.to_f
|
|
39
|
+
else
|
|
40
|
+
value
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def valid?(value)
|
|
46
|
+
!value || allowable_values.include?(value)
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
51
|
+
def self.attribute_map
|
|
52
|
+
{
|
|
53
|
+
:'id' => :'id',
|
|
54
|
+
:'event' => :'event',
|
|
55
|
+
:'timestamp' => :'timestamp',
|
|
56
|
+
:'verification' => :'verification',
|
|
57
|
+
:'reason' => :'reason'
|
|
58
|
+
}
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Returns attribute mapping this model knows about
|
|
62
|
+
def self.acceptable_attribute_map
|
|
63
|
+
attribute_map
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Returns all the JSON keys this model knows about
|
|
67
|
+
def self.acceptable_attributes
|
|
68
|
+
acceptable_attribute_map.values
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Attribute type mapping.
|
|
72
|
+
def self.openapi_types
|
|
73
|
+
{
|
|
74
|
+
:'id' => :'String',
|
|
75
|
+
:'event' => :'String',
|
|
76
|
+
:'timestamp' => :'Time',
|
|
77
|
+
:'verification' => :'OnVerificationFailedRequestVerification',
|
|
78
|
+
:'reason' => :'String'
|
|
79
|
+
}
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# List of attributes with nullable: true
|
|
83
|
+
def self.openapi_nullable
|
|
84
|
+
Set.new([
|
|
85
|
+
])
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Initializes the object
|
|
89
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
90
|
+
def initialize(attributes = {})
|
|
91
|
+
if (!attributes.is_a?(Hash))
|
|
92
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::OnVerificationFailedRequest` initialize method"
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
96
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
97
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
98
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
99
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::OnVerificationFailedRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
100
|
+
end
|
|
101
|
+
h[k.to_sym] = v
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if attributes.key?(:'id')
|
|
105
|
+
self.id = attributes[:'id']
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'event')
|
|
109
|
+
self.event = attributes[:'event']
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if attributes.key?(:'timestamp')
|
|
113
|
+
self.timestamp = attributes[:'timestamp']
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if attributes.key?(:'verification')
|
|
117
|
+
self.verification = attributes[:'verification']
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'reason')
|
|
121
|
+
self.reason = attributes[:'reason']
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
126
|
+
# @return Array for valid properties with the reasons
|
|
127
|
+
def list_invalid_properties
|
|
128
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
129
|
+
invalid_properties = Array.new
|
|
130
|
+
invalid_properties
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Check to see if the all the properties in the model are valid
|
|
134
|
+
# @return true if the model is valid
|
|
135
|
+
def valid?
|
|
136
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
137
|
+
event_validator = EnumAttributeValidator.new('String', ["verification.failed"])
|
|
138
|
+
return false unless event_validator.valid?(@event)
|
|
139
|
+
reason_validator = EnumAttributeValidator.new('String', ["max_attempts_reached"])
|
|
140
|
+
return false unless reason_validator.valid?(@reason)
|
|
141
|
+
true
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
145
|
+
# @param [Object] event Object to be assigned
|
|
146
|
+
def event=(event)
|
|
147
|
+
validator = EnumAttributeValidator.new('String', ["verification.failed"])
|
|
148
|
+
unless validator.valid?(event)
|
|
149
|
+
fail ArgumentError, "invalid value for \"event\", must be one of #{validator.allowable_values}."
|
|
150
|
+
end
|
|
151
|
+
@event = event
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
155
|
+
# @param [Object] reason Object to be assigned
|
|
156
|
+
def reason=(reason)
|
|
157
|
+
validator = EnumAttributeValidator.new('String', ["max_attempts_reached"])
|
|
158
|
+
unless validator.valid?(reason)
|
|
159
|
+
fail ArgumentError, "invalid value for \"reason\", must be one of #{validator.allowable_values}."
|
|
160
|
+
end
|
|
161
|
+
@reason = reason
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Checks equality by comparing each attribute.
|
|
165
|
+
# @param [Object] Object to be compared
|
|
166
|
+
def ==(o)
|
|
167
|
+
return true if self.equal?(o)
|
|
168
|
+
self.class == o.class &&
|
|
169
|
+
id == o.id &&
|
|
170
|
+
event == o.event &&
|
|
171
|
+
timestamp == o.timestamp &&
|
|
172
|
+
verification == o.verification &&
|
|
173
|
+
reason == o.reason
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# @see the `==` method
|
|
177
|
+
# @param [Object] Object to be compared
|
|
178
|
+
def eql?(o)
|
|
179
|
+
self == o
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Calculates hash code according to all attributes.
|
|
183
|
+
# @return [Integer] Hash code
|
|
184
|
+
def hash
|
|
185
|
+
[id, event, timestamp, verification, reason].hash
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# Builds the object from hash
|
|
189
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
190
|
+
# @return [Object] Returns the model itself
|
|
191
|
+
def self.build_from_hash(attributes)
|
|
192
|
+
return nil unless attributes.is_a?(Hash)
|
|
193
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
194
|
+
transformed_hash = {}
|
|
195
|
+
openapi_types.each_pair do |key, type|
|
|
196
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
197
|
+
transformed_hash["#{key}"] = nil
|
|
198
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
199
|
+
# check to ensure the input is an array given that the attribute
|
|
200
|
+
# is documented as an array but the input is not
|
|
201
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
202
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
203
|
+
end
|
|
204
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
205
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
new(transformed_hash)
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Returns the object in the form of hash
|
|
212
|
+
# @return [Hash] Returns the object in the form of hash
|
|
213
|
+
def to_hash
|
|
214
|
+
hash = {}
|
|
215
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
216
|
+
value = self.send(attr)
|
|
217
|
+
if value.nil?
|
|
218
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
219
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
hash[param] = _to_hash(value)
|
|
223
|
+
end
|
|
224
|
+
hash
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
end
|
|
@@ -0,0 +1,199 @@
|
|
|
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 OnVerificationFailedRequestVerification < ApiModelBase
|
|
18
|
+
attr_accessor :verification_id
|
|
19
|
+
|
|
20
|
+
attr_accessor :channel
|
|
21
|
+
|
|
22
|
+
attr_accessor :to
|
|
23
|
+
|
|
24
|
+
class EnumAttributeValidator
|
|
25
|
+
attr_reader :datatype
|
|
26
|
+
attr_reader :allowable_values
|
|
27
|
+
|
|
28
|
+
def initialize(datatype, allowable_values)
|
|
29
|
+
@allowable_values = allowable_values.map do |value|
|
|
30
|
+
case datatype.to_s
|
|
31
|
+
when /Integer/i
|
|
32
|
+
value.to_i
|
|
33
|
+
when /Float/i
|
|
34
|
+
value.to_f
|
|
35
|
+
else
|
|
36
|
+
value
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def valid?(value)
|
|
42
|
+
!value || allowable_values.include?(value)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
47
|
+
def self.attribute_map
|
|
48
|
+
{
|
|
49
|
+
:'verification_id' => :'verificationId',
|
|
50
|
+
:'channel' => :'channel',
|
|
51
|
+
:'to' => :'to'
|
|
52
|
+
}
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Returns attribute mapping this model knows about
|
|
56
|
+
def self.acceptable_attribute_map
|
|
57
|
+
attribute_map
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Returns all the JSON keys this model knows about
|
|
61
|
+
def self.acceptable_attributes
|
|
62
|
+
acceptable_attribute_map.values
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Attribute type mapping.
|
|
66
|
+
def self.openapi_types
|
|
67
|
+
{
|
|
68
|
+
:'verification_id' => :'String',
|
|
69
|
+
:'channel' => :'String',
|
|
70
|
+
:'to' => :'String'
|
|
71
|
+
}
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# List of attributes with nullable: true
|
|
75
|
+
def self.openapi_nullable
|
|
76
|
+
Set.new([
|
|
77
|
+
])
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Initializes the object
|
|
81
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
82
|
+
def initialize(attributes = {})
|
|
83
|
+
if (!attributes.is_a?(Hash))
|
|
84
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::OnVerificationFailedRequestVerification` initialize method"
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
88
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
89
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
90
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
91
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::OnVerificationFailedRequestVerification`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
92
|
+
end
|
|
93
|
+
h[k.to_sym] = v
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if attributes.key?(:'verification_id')
|
|
97
|
+
self.verification_id = attributes[:'verification_id']
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if attributes.key?(:'channel')
|
|
101
|
+
self.channel = attributes[:'channel']
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if attributes.key?(:'to')
|
|
105
|
+
self.to = attributes[:'to']
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
110
|
+
# @return Array for valid properties with the reasons
|
|
111
|
+
def list_invalid_properties
|
|
112
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
113
|
+
invalid_properties = Array.new
|
|
114
|
+
invalid_properties
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Check to see if the all the properties in the model are valid
|
|
118
|
+
# @return true if the model is valid
|
|
119
|
+
def valid?
|
|
120
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
121
|
+
channel_validator = EnumAttributeValidator.new('String', ["sms"])
|
|
122
|
+
return false unless channel_validator.valid?(@channel)
|
|
123
|
+
true
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
127
|
+
# @param [Object] channel Object to be assigned
|
|
128
|
+
def channel=(channel)
|
|
129
|
+
validator = EnumAttributeValidator.new('String', ["sms"])
|
|
130
|
+
unless validator.valid?(channel)
|
|
131
|
+
fail ArgumentError, "invalid value for \"channel\", must be one of #{validator.allowable_values}."
|
|
132
|
+
end
|
|
133
|
+
@channel = channel
|
|
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
|
+
verification_id == o.verification_id &&
|
|
142
|
+
channel == o.channel &&
|
|
143
|
+
to == o.to
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# @see the `==` method
|
|
147
|
+
# @param [Object] Object to be compared
|
|
148
|
+
def eql?(o)
|
|
149
|
+
self == o
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Calculates hash code according to all attributes.
|
|
153
|
+
# @return [Integer] Hash code
|
|
154
|
+
def hash
|
|
155
|
+
[verification_id, channel, to].hash
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Builds the object from hash
|
|
159
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
160
|
+
# @return [Object] Returns the model itself
|
|
161
|
+
def self.build_from_hash(attributes)
|
|
162
|
+
return nil unless attributes.is_a?(Hash)
|
|
163
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
164
|
+
transformed_hash = {}
|
|
165
|
+
openapi_types.each_pair do |key, type|
|
|
166
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
167
|
+
transformed_hash["#{key}"] = nil
|
|
168
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
169
|
+
# check to ensure the input is an array given that the attribute
|
|
170
|
+
# is documented as an array but the input is not
|
|
171
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
172
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
173
|
+
end
|
|
174
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
175
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
new(transformed_hash)
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Returns the object in the form of hash
|
|
182
|
+
# @return [Hash] Returns the object in the form of hash
|
|
183
|
+
def to_hash
|
|
184
|
+
hash = {}
|
|
185
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
186
|
+
value = self.send(attr)
|
|
187
|
+
if value.nil?
|
|
188
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
189
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
hash[param] = _to_hash(value)
|
|
193
|
+
end
|
|
194
|
+
hash
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
end
|
|
@@ -126,7 +126,7 @@ module Zernio
|
|
|
126
126
|
# @return true if the model is valid
|
|
127
127
|
def valid?
|
|
128
128
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
129
|
-
event_validator = EnumAttributeValidator.new('String', ["whatsapp.number.kyc_submitted"])
|
|
129
|
+
event_validator = EnumAttributeValidator.new('String', ["whatsapp.number.kyc_submitted", "verification.approved", "verification.failed"])
|
|
130
130
|
return false unless event_validator.valid?(@event)
|
|
131
131
|
true
|
|
132
132
|
end
|
|
@@ -134,7 +134,7 @@ module Zernio
|
|
|
134
134
|
# Custom attribute writer method checking allowed values (enum).
|
|
135
135
|
# @param [Object] event Object to be assigned
|
|
136
136
|
def event=(event)
|
|
137
|
-
validator = EnumAttributeValidator.new('String', ["whatsapp.number.kyc_submitted"])
|
|
137
|
+
validator = EnumAttributeValidator.new('String', ["whatsapp.number.kyc_submitted", "verification.approved", "verification.failed"])
|
|
138
138
|
unless validator.valid?(event)
|
|
139
139
|
fail ArgumentError, "invalid value for \"event\", must be one of #{validator.allowable_values}."
|
|
140
140
|
end
|