onfido 3.3.1 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,241 @@
1
+ =begin
2
+ #Onfido API v3.6
3
+
4
+ #The Onfido API (v3.6)
5
+
6
+ The version of the OpenAPI document: v3.6
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.6.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Onfido
17
+ class WatchlistEnhancedPropertiesRecordsInnerSourceInner
18
+ attr_accessor :source_headline
19
+
20
+ attr_accessor :source_name
21
+
22
+ attr_accessor :source_url
23
+
24
+ attr_accessor :source_format
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'source_headline' => :'source_headline',
30
+ :'source_name' => :'source_name',
31
+ :'source_url' => :'source_url',
32
+ :'source_format' => :'source_format'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'source_headline' => :'String',
45
+ :'source_name' => :'String',
46
+ :'source_url' => :'String',
47
+ :'source_format' => :'String'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Onfido::WatchlistEnhancedPropertiesRecordsInnerSourceInner` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Onfido::WatchlistEnhancedPropertiesRecordsInnerSourceInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'source_headline')
73
+ self.source_headline = attributes[:'source_headline']
74
+ end
75
+
76
+ if attributes.key?(:'source_name')
77
+ self.source_name = attributes[:'source_name']
78
+ end
79
+
80
+ if attributes.key?(:'source_url')
81
+ self.source_url = attributes[:'source_url']
82
+ end
83
+
84
+ if attributes.key?(:'source_format')
85
+ self.source_format = attributes[:'source_format']
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
93
+ invalid_properties = Array.new
94
+ invalid_properties
95
+ end
96
+
97
+ # Check to see if the all the properties in the model are valid
98
+ # @return true if the model is valid
99
+ def valid?
100
+ warn '[DEPRECATED] the `valid?` method is obsolete'
101
+ true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ source_headline == o.source_headline &&
110
+ source_name == o.source_name &&
111
+ source_url == o.source_url &&
112
+ source_format == o.source_format
113
+ end
114
+
115
+ # @see the `==` method
116
+ # @param [Object] Object to be compared
117
+ def eql?(o)
118
+ self == o
119
+ end
120
+
121
+ # Calculates hash code according to all attributes.
122
+ # @return [Integer] Hash code
123
+ def hash
124
+ [source_headline, source_name, source_url, source_format].hash
125
+ end
126
+
127
+ # Builds the object from hash
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ # @return [Object] Returns the model itself
130
+ def self.build_from_hash(attributes)
131
+ return nil unless attributes.is_a?(Hash)
132
+ attributes = attributes.transform_keys(&:to_sym)
133
+ transformed_hash = {}
134
+ openapi_types.each_pair do |key, type|
135
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
136
+ transformed_hash["#{key}"] = nil
137
+ elsif type =~ /\AArray<(.*)>/i
138
+ # check to ensure the input is an array given that the attribute
139
+ # is documented as an array but the input is not
140
+ if attributes[attribute_map[key]].is_a?(Array)
141
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
142
+ end
143
+ elsif !attributes[attribute_map[key]].nil?
144
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
145
+ end
146
+ end
147
+ new(transformed_hash)
148
+ end
149
+
150
+ # Deserializes the data based on type
151
+ # @param string type Data type
152
+ # @param string value Value to be deserialized
153
+ # @return [Object] Deserialized data
154
+ def self._deserialize(type, value)
155
+ case type.to_sym
156
+ when :Time
157
+ Time.parse(value)
158
+ when :Date
159
+ Date.parse(value)
160
+ when :String
161
+ value.to_s
162
+ when :Integer
163
+ value.to_i
164
+ when :Float
165
+ value.to_f
166
+ when :Boolean
167
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
168
+ true
169
+ else
170
+ false
171
+ end
172
+ when :Object
173
+ # generic object (usually a Hash), return directly
174
+ value
175
+ when /\AArray<(?<inner_type>.+)>\z/
176
+ inner_type = Regexp.last_match[:inner_type]
177
+ value.map { |v| _deserialize(inner_type, v) }
178
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
179
+ k_type = Regexp.last_match[:k_type]
180
+ v_type = Regexp.last_match[:v_type]
181
+ {}.tap do |hash|
182
+ value.each do |k, v|
183
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
184
+ end
185
+ end
186
+ else # model
187
+ # models (e.g. Pet) or oneOf
188
+ klass = Onfido.const_get(type)
189
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
190
+ end
191
+ end
192
+
193
+ # Returns the string representation of the object
194
+ # @return [String] String presentation of the object
195
+ def to_s
196
+ to_hash.to_s
197
+ end
198
+
199
+ # to_body is an alias to to_hash (backward compatibility)
200
+ # @return [Hash] Returns the object in the form of hash
201
+ def to_body
202
+ to_hash
203
+ end
204
+
205
+ # Returns the object in the form of hash
206
+ # @return [Hash] Returns the object in the form of hash
207
+ def to_hash
208
+ hash = {}
209
+ self.class.attribute_map.each_pair do |attr, param|
210
+ value = self.send(attr)
211
+ if value.nil?
212
+ is_nullable = self.class.openapi_nullable.include?(attr)
213
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
214
+ end
215
+
216
+ hash[param] = _to_hash(value)
217
+ end
218
+ hash
219
+ end
220
+
221
+ # Outputs non-array value in the form of hash
222
+ # For object, use to_hash. Otherwise, just return the value
223
+ # @param [Object] value Any valid value
224
+ # @return [Hash] Returns the value in the form of hash
225
+ def _to_hash(value)
226
+ if value.is_a?(Array)
227
+ value.compact.map { |v| _to_hash(v) }
228
+ elsif value.is_a?(Hash)
229
+ {}.tap do |hash|
230
+ value.each { |k, v| hash[k] = _to_hash(v) }
231
+ end
232
+ elsif value.respond_to? :to_hash
233
+ value.to_hash
234
+ else
235
+ value
236
+ end
237
+ end
238
+
239
+ end
240
+
241
+ end
@@ -11,5 +11,5 @@ Generator version: 7.6.0
11
11
  =end
12
12
 
13
13
  module Onfido
14
- VERSION = '3.3.1'
14
+ VERSION = '3.4.0'
15
15
  end
data/lib/onfido.rb CHANGED
@@ -257,6 +257,14 @@ require 'onfido/models/watchlist_aml_properties'
257
257
  require 'onfido/models/watchlist_aml_report'
258
258
  require 'onfido/models/watchlist_enhanced_breakdown'
259
259
  require 'onfido/models/watchlist_enhanced_properties'
260
+ require 'onfido/models/watchlist_enhanced_properties_records_inner'
261
+ require 'onfido/models/watchlist_enhanced_properties_records_inner_address_inner'
262
+ require 'onfido/models/watchlist_enhanced_properties_records_inner_alias_inner'
263
+ require 'onfido/models/watchlist_enhanced_properties_records_inner_associate_inner'
264
+ require 'onfido/models/watchlist_enhanced_properties_records_inner_attribute_inner'
265
+ require 'onfido/models/watchlist_enhanced_properties_records_inner_event_inner'
266
+ require 'onfido/models/watchlist_enhanced_properties_records_inner_event_inner_source'
267
+ require 'onfido/models/watchlist_enhanced_properties_records_inner_source_inner'
260
268
  require 'onfido/models/watchlist_enhanced_report'
261
269
  require 'onfido/models/watchlist_monitor'
262
270
  require 'onfido/models/watchlist_monitor_builder'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onfido
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.1
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenAPI-Generator
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-22 00:00:00.000000000 Z
11
+ date: 2024-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -377,6 +377,14 @@ files:
377
377
  - lib/onfido/models/watchlist_aml_report.rb
378
378
  - lib/onfido/models/watchlist_enhanced_breakdown.rb
379
379
  - lib/onfido/models/watchlist_enhanced_properties.rb
380
+ - lib/onfido/models/watchlist_enhanced_properties_records_inner.rb
381
+ - lib/onfido/models/watchlist_enhanced_properties_records_inner_address_inner.rb
382
+ - lib/onfido/models/watchlist_enhanced_properties_records_inner_alias_inner.rb
383
+ - lib/onfido/models/watchlist_enhanced_properties_records_inner_associate_inner.rb
384
+ - lib/onfido/models/watchlist_enhanced_properties_records_inner_attribute_inner.rb
385
+ - lib/onfido/models/watchlist_enhanced_properties_records_inner_event_inner.rb
386
+ - lib/onfido/models/watchlist_enhanced_properties_records_inner_event_inner_source.rb
387
+ - lib/onfido/models/watchlist_enhanced_properties_records_inner_source_inner.rb
380
388
  - lib/onfido/models/watchlist_enhanced_report.rb
381
389
  - lib/onfido/models/watchlist_monitor.rb
382
390
  - lib/onfido/models/watchlist_monitor_builder.rb
@@ -468,30 +476,30 @@ specification_version: 4
468
476
  summary: The official Ruby library for integrating with the Onfido API.
469
477
  test_files:
470
478
  - spec/integrations/document_spec.rb
471
- - spec/integrations/address_picker_spec.rb
472
- - spec/integrations/motion_capture_spec.rb
473
- - spec/integrations/webhook_spec.rb
474
- - spec/integrations/live_video_spec.rb
475
- - spec/integrations/live_photo_spec.rb
476
479
  - spec/integrations/qualified_electronic_signature_spec.rb
477
- - spec/integrations/check_spec.rb
478
- - spec/integrations/tasks_spec.rb
479
- - spec/integrations/sdk_token_spec.rb
480
480
  - spec/integrations/workflow_run_output_spec.rb
481
- - spec/integrations/report_schema_spec.rb
481
+ - spec/integrations/check_spec.rb
482
482
  - spec/integrations/watchlist_monitor_spec.rb
483
- - spec/integrations/workflow_run_spec.rb
484
483
  - spec/integrations/applicant_spec.rb
485
484
  - spec/integrations/media/sample_driving_licence.png
486
485
  - spec/integrations/media/sample_photo.png
486
+ - spec/integrations/tasks_spec.rb
487
+ - spec/integrations/live_video_spec.rb
488
+ - spec/integrations/motion_capture_spec.rb
489
+ - spec/integrations/sdk_token_spec.rb
490
+ - spec/integrations/workflow_run_spec.rb
491
+ - spec/integrations/extraction_spec.rb
492
+ - spec/integrations/address_picker_spec.rb
487
493
  - spec/integrations/id_photo_spec.rb
494
+ - spec/integrations/report_schema_spec.rb
495
+ - spec/integrations/webhook_spec.rb
496
+ - spec/integrations/live_photo_spec.rb
488
497
  - spec/integrations/report_spec.rb
489
- - spec/integrations/extraction_spec.rb
490
- - spec/shared_contexts/with_applicant.rb
498
+ - spec/shared_contexts/with_check.rb
491
499
  - spec/shared_contexts/with_live_photo.rb
492
500
  - spec/shared_contexts/with_document.rb
493
- - spec/shared_contexts/with_check.rb
494
- - spec/shared_contexts/with_workflow_run.rb
495
501
  - spec/shared_contexts/with_onfido.rb
502
+ - spec/shared_contexts/with_workflow_run.rb
503
+ - spec/shared_contexts/with_applicant.rb
496
504
  - spec/spec_helper.rb
497
505
  - spec/webhook_event_verifier_spec.rb