sc-apimatic-sdk 0.0.1

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.
Files changed (122) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +166 -0
  4. data/bin/console +15 -0
  5. data/lib/socure_risk_os_api/api_helper.rb +10 -0
  6. data/lib/socure_risk_os_api/apis/base_api.rb +67 -0
  7. data/lib/socure_risk_os_api/apis/evaluation_api.rb +318 -0
  8. data/lib/socure_risk_os_api/apis/feedback_api.rb +102 -0
  9. data/lib/socure_risk_os_api/apis/reason_codes_api.rb +61 -0
  10. data/lib/socure_risk_os_api/client.rb +85 -0
  11. data/lib/socure_risk_os_api/configuration.rb +179 -0
  12. data/lib/socure_risk_os_api/exceptions/api_exception.rb +21 -0
  13. data/lib/socure_risk_os_api/exceptions/error_exception.rb +80 -0
  14. data/lib/socure_risk_os_api/http/api_response.rb +19 -0
  15. data/lib/socure_risk_os_api/http/auth/oauth_2.rb +53 -0
  16. data/lib/socure_risk_os_api/http/http_call_back.rb +10 -0
  17. data/lib/socure_risk_os_api/http/http_method_enum.rb +10 -0
  18. data/lib/socure_risk_os_api/http/http_request.rb +10 -0
  19. data/lib/socure_risk_os_api/http/http_response.rb +10 -0
  20. data/lib/socure_risk_os_api/http/proxy_settings.rb +22 -0
  21. data/lib/socure_risk_os_api/logging/configuration/api_logging_configuration.rb +186 -0
  22. data/lib/socure_risk_os_api/logging/sdk_logger.rb +17 -0
  23. data/lib/socure_risk_os_api/models/account.rb +206 -0
  24. data/lib/socure_risk_os_api/models/account1.rb +203 -0
  25. data/lib/socure_risk_os_api/models/account_inquiry.rb +36 -0
  26. data/lib/socure_risk_os_api/models/account_snapshot.rb +106 -0
  27. data/lib/socure_risk_os_api/models/account_view.rb +116 -0
  28. data/lib/socure_risk_os_api/models/actions.rb +88 -0
  29. data/lib/socure_risk_os_api/models/additional_context.rb +235 -0
  30. data/lib/socure_risk_os_api/models/additional_individual.rb +270 -0
  31. data/lib/socure_risk_os_api/models/address.rb +159 -0
  32. data/lib/socure_risk_os_api/models/address1.rb +144 -0
  33. data/lib/socure_risk_os_api/models/advanced_prefill.rb +168 -0
  34. data/lib/socure_risk_os_api/models/age_assurance.rb +163 -0
  35. data/lib/socure_risk_os_api/models/amount.rb +95 -0
  36. data/lib/socure_risk_os_api/models/api_evaluation_monitoring_request.rb +96 -0
  37. data/lib/socure_risk_os_api/models/api_evaluation_monitoring_response.rb +84 -0
  38. data/lib/socure_risk_os_api/models/api_feedback_request.rb +153 -0
  39. data/lib/socure_risk_os_api/models/api_reason_codes_response.rb +85 -0
  40. data/lib/socure_risk_os_api/models/attachment.rb +95 -0
  41. data/lib/socure_risk_os_api/models/bank_account_verification.rb +167 -0
  42. data/lib/socure_risk_os_api/models/base_model.rb +110 -0
  43. data/lib/socure_risk_os_api/models/business.rb +224 -0
  44. data/lib/socure_risk_os_api/models/business_onboarding.rb +167 -0
  45. data/lib/socure_risk_os_api/models/channel.rb +45 -0
  46. data/lib/socure_risk_os_api/models/channel1.rb +44 -0
  47. data/lib/socure_risk_os_api/models/code.rb +68 -0
  48. data/lib/socure_risk_os_api/models/consumer_onboarding.rb +167 -0
  49. data/lib/socure_risk_os_api/models/consumer_onboarding_patch.rb +178 -0
  50. data/lib/socure_risk_os_api/models/crypto_address.rb +105 -0
  51. data/lib/socure_risk_os_api/models/data.rb +106 -0
  52. data/lib/socure_risk_os_api/models/data1.rb +166 -0
  53. data/lib/socure_risk_os_api/models/data10.rb +166 -0
  54. data/lib/socure_risk_os_api/models/data2.rb +145 -0
  55. data/lib/socure_risk_os_api/models/data3.rb +160 -0
  56. data/lib/socure_risk_os_api/models/data4.rb +157 -0
  57. data/lib/socure_risk_os_api/models/data5.rb +154 -0
  58. data/lib/socure_risk_os_api/models/data6.rb +174 -0
  59. data/lib/socure_risk_os_api/models/data7.rb +205 -0
  60. data/lib/socure_risk_os_api/models/data8.rb +115 -0
  61. data/lib/socure_risk_os_api/models/data9.rb +130 -0
  62. data/lib/socure_risk_os_api/models/data_enrichment.rb +182 -0
  63. data/lib/socure_risk_os_api/models/decision.rb +47 -0
  64. data/lib/socure_risk_os_api/models/decision1.rb +48 -0
  65. data/lib/socure_risk_os_api/models/destination.rb +136 -0
  66. data/lib/socure_risk_os_api/models/device.rb +339 -0
  67. data/lib/socure_risk_os_api/models/disclosure_purpose.rb +29 -0
  68. data/lib/socure_risk_os_api/models/document_verification_config.rb +195 -0
  69. data/lib/socure_risk_os_api/models/docv.rb +98 -0
  70. data/lib/socure_risk_os_api/models/environment_name.rb +37 -0
  71. data/lib/socure_risk_os_api/models/eval_response_with_out_socure_data.rb +413 -0
  72. data/lib/socure_risk_os_api/models/eval_source.rb +38 -0
  73. data/lib/socure_risk_os_api/models/event_category.rb +45 -0
  74. data/lib/socure_risk_os_api/models/event_category1.rb +45 -0
  75. data/lib/socure_risk_os_api/models/event_category2.rb +57 -0
  76. data/lib/socure_risk_os_api/models/event_details.rb +96 -0
  77. data/lib/socure_risk_os_api/models/formation.rb +138 -0
  78. data/lib/socure_risk_os_api/models/fraud_feedback_import_response.rb +73 -0
  79. data/lib/socure_risk_os_api/models/fraud_feedback_response.rb +73 -0
  80. data/lib/socure_risk_os_api/models/fraud_label.rb +37 -0
  81. data/lib/socure_risk_os_api/models/gender.rb +40 -0
  82. data/lib/socure_risk_os_api/models/generic_passthrough.rb +169 -0
  83. data/lib/socure_risk_os_api/models/individual.rb +281 -0
  84. data/lib/socure_risk_os_api/models/individual1.rb +292 -0
  85. data/lib/socure_risk_os_api/models/individual3.rb +206 -0
  86. data/lib/socure_risk_os_api/models/individual4.rb +182 -0
  87. data/lib/socure_risk_os_api/models/individual5.rb +297 -0
  88. data/lib/socure_risk_os_api/models/individual6.rb +148 -0
  89. data/lib/socure_risk_os_api/models/input.rb +86 -0
  90. data/lib/socure_risk_os_api/models/inquiry.rb +36 -0
  91. data/lib/socure_risk_os_api/models/invalid_arg.rb +85 -0
  92. data/lib/socure_risk_os_api/models/language.rb +247 -0
  93. data/lib/socure_risk_os_api/models/login_and_authentication.rb +167 -0
  94. data/lib/socure_risk_os_api/models/method.rb +37 -0
  95. data/lib/socure_risk_os_api/models/monitoring_status.rb +37 -0
  96. data/lib/socure_risk_os_api/models/operation.rb +38 -0
  97. data/lib/socure_risk_os_api/models/otp.rb +95 -0
  98. data/lib/socure_risk_os_api/models/otp1.rb +98 -0
  99. data/lib/socure_risk_os_api/models/payment_screening.rb +167 -0
  100. data/lib/socure_risk_os_api/models/payment_screening_business.rb +155 -0
  101. data/lib/socure_risk_os_api/models/payment_screening_individual.rb +254 -0
  102. data/lib/socure_risk_os_api/models/payment_screening_instrument.rb +105 -0
  103. data/lib/socure_risk_os_api/models/product.rb +76 -0
  104. data/lib/socure_risk_os_api/models/reason_code.rb +149 -0
  105. data/lib/socure_risk_os_api/models/redirect.rb +118 -0
  106. data/lib/socure_risk_os_api/models/response.rb +77 -0
  107. data/lib/socure_risk_os_api/models/source.rb +146 -0
  108. data/lib/socure_risk_os_api/models/status.rb +40 -0
  109. data/lib/socure_risk_os_api/models/status1.rb +40 -0
  110. data/lib/socure_risk_os_api/models/transaction_details.rb +97 -0
  111. data/lib/socure_risk_os_api/models/trust_and_safety.rb +167 -0
  112. data/lib/socure_risk_os_api/models/type.rb +36 -0
  113. data/lib/socure_risk_os_api/models/type1.rb +36 -0
  114. data/lib/socure_risk_os_api/models/type2.rb +36 -0
  115. data/lib/socure_risk_os_api/models/update_decision.rb +156 -0
  116. data/lib/socure_risk_os_api/models/update_status.rb +169 -0
  117. data/lib/socure_risk_os_api/models/workforce_verification.rb +167 -0
  118. data/lib/socure_risk_os_api/utilities/date_time_helper.rb +11 -0
  119. data/lib/socure_risk_os_api/utilities/file_wrapper.rb +28 -0
  120. data/lib/socure_risk_os_api/utilities/union_type_lookup.rb +69 -0
  121. data/lib/socure_risk_os_api.rb +143 -0
  122. metadata +205 -0
@@ -0,0 +1,153 @@
1
+ # socure_risk_os_api
2
+ #
3
+ # This file was automatically generated by APIMATIC
4
+ # v3.0 ( https://www.apimatic.io ).
5
+
6
+ module SocureRiskOsApi
7
+ # ApiFeedbackRequest Model.
8
+ class ApiFeedbackRequest < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The customer-side identifier (`id`) provided during the original
13
+ # evaluation request.
14
+ # @return [String]
15
+ attr_accessor :id
16
+
17
+ # The environment-specific Workflow identifier that the ID is associated
18
+ # with. <br /><br /> **Note:** The workflow name must be unique within your
19
+ # RiskOS™ environment. It is not scoped by use case and must identify a
20
+ # single active workflow for each Evaluation API request.
21
+ # @return [String]
22
+ attr_accessor :workflow
23
+
24
+ # The fraud label for an application. Accepted values are `fraud` and
25
+ # `non-fraud`.
26
+ # @return [FraudLabel]
27
+ attr_accessor :fraud_label
28
+
29
+ # The fraud typology or category that best describes the nature of the
30
+ # fraud.
31
+ # @return [String]
32
+ attr_accessor :fraud_type
33
+
34
+ # Optional notes or additional information to be added to the case.
35
+ # @return [String]
36
+ attr_accessor :notes
37
+
38
+ # The date when the event was recorded. Use the `YYYY-MM-DD` format as
39
+ # defined by the [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339)
40
+ # full-date standard. If omitted, defaults to the current date.
41
+ # @return [Date]
42
+ attr_accessor :recorded_at
43
+
44
+ # The name or identifier of the person who recorded the fraud. If omitted,
45
+ # defaults to the authenticated user.
46
+ # @return [String]
47
+ attr_accessor :recorded_by
48
+
49
+ # Tags to categorize or label the fraud case. Useful for filtering,
50
+ # reporting, or internal tracking. Tags are validated against the
51
+ # namespace's configured tag definitions. If any tag is invalid, the request
52
+ # returns a `400` error.
53
+ # @return [Array[String]]
54
+ attr_accessor :tags
55
+
56
+ # A mapping from model property names to API property names.
57
+ def self.names
58
+ @_hash = {} if @_hash.nil?
59
+ @_hash['id'] = 'id'
60
+ @_hash['workflow'] = 'workflow'
61
+ @_hash['fraud_label'] = 'fraud_label'
62
+ @_hash['fraud_type'] = 'fraud_type'
63
+ @_hash['notes'] = 'notes'
64
+ @_hash['recorded_at'] = 'recorded_at'
65
+ @_hash['recorded_by'] = 'recorded_by'
66
+ @_hash['tags'] = 'tags'
67
+ @_hash
68
+ end
69
+
70
+ # An array for optional fields
71
+ def self.optionals
72
+ %w[
73
+ fraud_type
74
+ notes
75
+ recorded_at
76
+ recorded_by
77
+ tags
78
+ ]
79
+ end
80
+
81
+ # An array for nullable fields
82
+ def self.nullables
83
+ []
84
+ end
85
+
86
+ def initialize(id:, workflow:, fraud_label:, fraud_type: SKIP, notes: SKIP,
87
+ recorded_at: SKIP, recorded_by: SKIP, tags: SKIP,
88
+ additional_properties: nil)
89
+ # Add additional model properties to the instance
90
+ additional_properties = {} if additional_properties.nil?
91
+
92
+ @id = id
93
+ @workflow = workflow
94
+ @fraud_label = fraud_label
95
+ @fraud_type = fraud_type unless fraud_type == SKIP
96
+ @notes = notes unless notes == SKIP
97
+ @recorded_at = recorded_at unless recorded_at == SKIP
98
+ @recorded_by = recorded_by unless recorded_by == SKIP
99
+ @tags = tags unless tags == SKIP
100
+ @additional_properties = additional_properties
101
+ end
102
+
103
+ # Creates an instance of the object from a hash.
104
+ def self.from_hash(hash)
105
+ return nil unless hash
106
+
107
+ # Extract variables from the hash.
108
+ id = hash.key?('id') ? hash['id'] : nil
109
+ workflow = hash.key?('workflow') ? hash['workflow'] : nil
110
+ fraud_label = hash.key?('fraud_label') ? hash['fraud_label'] : nil
111
+ fraud_type = hash.key?('fraud_type') ? hash['fraud_type'] : SKIP
112
+ notes = hash.key?('notes') ? hash['notes'] : SKIP
113
+ recorded_at = hash.key?('recorded_at') ? hash['recorded_at'] : SKIP
114
+ recorded_by = hash.key?('recorded_by') ? hash['recorded_by'] : SKIP
115
+ tags = hash.key?('tags') ? hash['tags'] : SKIP
116
+
117
+ # Create a new hash for additional properties, removing known properties.
118
+ new_hash = hash.reject { |k, _| names.value?(k) }
119
+
120
+ additional_properties = APIHelper.get_additional_properties(
121
+ new_hash, proc { |value| value }
122
+ )
123
+
124
+ # Create object from extracted values.
125
+ ApiFeedbackRequest.new(id: id,
126
+ workflow: workflow,
127
+ fraud_label: fraud_label,
128
+ fraud_type: fraud_type,
129
+ notes: notes,
130
+ recorded_at: recorded_at,
131
+ recorded_by: recorded_by,
132
+ tags: tags,
133
+ additional_properties: additional_properties)
134
+ end
135
+
136
+ # Provides a human-readable string representation of the object.
137
+ def to_s
138
+ class_name = self.class.name.split('::').last
139
+ "<#{class_name} id: #{@id}, workflow: #{@workflow}, fraud_label: #{@fraud_label},"\
140
+ " fraud_type: #{@fraud_type}, notes: #{@notes}, recorded_at: #{@recorded_at}, recorded_by:"\
141
+ " #{@recorded_by}, tags: #{@tags}, additional_properties: #{@additional_properties}>"
142
+ end
143
+
144
+ # Provides a debugging-friendly string with detailed object information.
145
+ def inspect
146
+ class_name = self.class.name.split('::').last
147
+ "<#{class_name} id: #{@id.inspect}, workflow: #{@workflow.inspect}, fraud_label:"\
148
+ " #{@fraud_label.inspect}, fraud_type: #{@fraud_type.inspect}, notes: #{@notes.inspect},"\
149
+ " recorded_at: #{@recorded_at.inspect}, recorded_by: #{@recorded_by.inspect}, tags:"\
150
+ " #{@tags.inspect}, additional_properties: #{@additional_properties}>"
151
+ end
152
+ end
153
+ end
@@ -0,0 +1,85 @@
1
+ # socure_risk_os_api
2
+ #
3
+ # This file was automatically generated by APIMATIC
4
+ # v3.0 ( https://www.apimatic.io ).
5
+
6
+ module SocureRiskOsApi
7
+ # ApiReasonCodesResponse Model.
8
+ class ApiReasonCodesResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The list of reason codes that match the request.
13
+ # @return [Array[ReasonCode]]
14
+ attr_accessor :reason_codes
15
+
16
+ # A mapping from model property names to API property names.
17
+ def self.names
18
+ @_hash = {} if @_hash.nil?
19
+ @_hash['reason_codes'] = 'reasonCodes'
20
+ @_hash
21
+ end
22
+
23
+ # An array for optional fields
24
+ def self.optionals
25
+ %w[
26
+ reason_codes
27
+ ]
28
+ end
29
+
30
+ # An array for nullable fields
31
+ def self.nullables
32
+ []
33
+ end
34
+
35
+ def initialize(reason_codes: SKIP, additional_properties: nil)
36
+ # Add additional model properties to the instance
37
+ additional_properties = {} if additional_properties.nil?
38
+
39
+ @reason_codes = reason_codes unless reason_codes == SKIP
40
+ @additional_properties = additional_properties
41
+ end
42
+
43
+ # Creates an instance of the object from a hash.
44
+ def self.from_hash(hash)
45
+ return nil unless hash
46
+
47
+ # Extract variables from the hash.
48
+ # Parameter is an array, so we need to iterate through it
49
+ reason_codes = nil
50
+ unless hash['reasonCodes'].nil?
51
+ reason_codes = []
52
+ hash['reasonCodes'].each do |structure|
53
+ reason_codes << (ReasonCode.from_hash(structure) if structure)
54
+ end
55
+ end
56
+
57
+ reason_codes = SKIP unless hash.key?('reasonCodes')
58
+
59
+ # Create a new hash for additional properties, removing known properties.
60
+ new_hash = hash.reject { |k, _| names.value?(k) }
61
+
62
+ additional_properties = APIHelper.get_additional_properties(
63
+ new_hash, proc { |value| value }
64
+ )
65
+
66
+ # Create object from extracted values.
67
+ ApiReasonCodesResponse.new(reason_codes: reason_codes,
68
+ additional_properties: additional_properties)
69
+ end
70
+
71
+ # Provides a human-readable string representation of the object.
72
+ def to_s
73
+ class_name = self.class.name.split('::').last
74
+ "<#{class_name} reason_codes: #{@reason_codes}, additional_properties:"\
75
+ " #{@additional_properties}>"
76
+ end
77
+
78
+ # Provides a debugging-friendly string with detailed object information.
79
+ def inspect
80
+ class_name = self.class.name.split('::').last
81
+ "<#{class_name} reason_codes: #{@reason_codes.inspect}, additional_properties:"\
82
+ " #{@additional_properties}>"
83
+ end
84
+ end
85
+ end
@@ -0,0 +1,95 @@
1
+ # socure_risk_os_api
2
+ #
3
+ # This file was automatically generated by APIMATIC
4
+ # v3.0 ( https://www.apimatic.io ).
5
+
6
+ module SocureRiskOsApi
7
+ # Attachment Model.
8
+ class Attachment < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :file_name
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [String]
18
+ attr_accessor :file_data
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['file_name'] = 'file_name'
24
+ @_hash['file_data'] = 'file_data'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ %w[
31
+ file_name
32
+ file_data
33
+ ]
34
+ end
35
+
36
+ # An array for nullable fields
37
+ def self.nullables
38
+ []
39
+ end
40
+
41
+ def initialize(file_name: SKIP, file_data: SKIP, additional_properties: nil)
42
+ # Add additional model properties to the instance
43
+ additional_properties = {} if additional_properties.nil?
44
+
45
+ @file_name = file_name unless file_name == SKIP
46
+ @file_data = file_data unless file_data == SKIP
47
+ @additional_properties = additional_properties
48
+ end
49
+
50
+ # Creates an instance of the object from a hash.
51
+ def self.from_hash(hash)
52
+ return nil unless hash
53
+
54
+ # Extract variables from the hash.
55
+ file_name = hash.key?('file_name') ? hash['file_name'] : SKIP
56
+ file_data = hash.key?('file_data') ? hash['file_data'] : SKIP
57
+
58
+ # Create a new hash for additional properties, removing known properties.
59
+ new_hash = hash.reject { |k, _| names.value?(k) }
60
+
61
+ additional_properties = APIHelper.get_additional_properties(
62
+ new_hash, proc { |value| value }
63
+ )
64
+
65
+ # Create object from extracted values.
66
+ Attachment.new(file_name: file_name,
67
+ file_data: file_data,
68
+ additional_properties: additional_properties)
69
+ end
70
+
71
+ # Validates an instance of the object from a given value.
72
+ # @param [Attachment | Hash] The value against the validation is performed.
73
+ def self.validate(value)
74
+ return true if value.instance_of? self
75
+
76
+ return false unless value.instance_of? Hash
77
+
78
+ true
79
+ end
80
+
81
+ # Provides a human-readable string representation of the object.
82
+ def to_s
83
+ class_name = self.class.name.split('::').last
84
+ "<#{class_name} file_name: #{@file_name}, file_data: #{@file_data}, additional_properties:"\
85
+ " #{@additional_properties}>"
86
+ end
87
+
88
+ # Provides a debugging-friendly string with detailed object information.
89
+ def inspect
90
+ class_name = self.class.name.split('::').last
91
+ "<#{class_name} file_name: #{@file_name.inspect}, file_data: #{@file_data.inspect},"\
92
+ " additional_properties: #{@additional_properties}>"
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,167 @@
1
+ # socure_risk_os_api
2
+ #
3
+ # This file was automatically generated by APIMATIC
4
+ # v3.0 ( https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module SocureRiskOsApi
8
+ # BankAccountVerification Model.
9
+ class BankAccountVerification < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Your environment-specific workflow identifier. You can find this value in
14
+ # the RiskOS™ Dashboard > Developer Workbench > Integration Checklist. <br
15
+ # /><br /> **Note:** The workflow name must be unique within your RiskOS™
16
+ # environment. It is not scoped by use case and must identify a single
17
+ # active workflow for each Evaluation API request.
18
+ # @return [String]
19
+ attr_accessor :workflow
20
+
21
+ # Required, customer-defined unique identifier for the request. <br /><br />
22
+ # This value must be unique for each evaluation. Reusing an ID causes
23
+ # RiskOS™ to treat the request as a re-run and can impact processing
24
+ # behavior, results, and downstream workflows.
25
+ # @return [String]
26
+ attr_accessor :id
27
+
28
+ # The timestamp indicating when the evaluation was initiated, in ISO 8601 /
29
+ # RFC 3339 format.
30
+ # @return [DateTime]
31
+ attr_accessor :timestamp
32
+
33
+ # Optional, opaque JSON object echoed back unchanged on the response and at
34
+ # the top level of webhook callbacks — use it to route and correlate
35
+ # requests. Must be a JSON object of up to 200 characters total (the entire
36
+ # serialized JSON); larger payloads return `413
37
+ # CUSTOMER_METADATA_TOO_LARGE`. Omit it or send `null` to skip. Don't
38
+ # include PII or secrets. See [Customer
39
+ # Metadata](https://help.socure.com/riskos/docs/customer-metadata).
40
+ # @return [Object]
41
+ attr_accessor :customer_metadata
42
+
43
+ # The main payload for the Bank Account Verification workflow.
44
+ # @return [Data5]
45
+ attr_accessor :data
46
+
47
+ # A mapping from model property names to API property names.
48
+ def self.names
49
+ @_hash = {} if @_hash.nil?
50
+ @_hash['workflow'] = 'workflow'
51
+ @_hash['id'] = 'id'
52
+ @_hash['timestamp'] = 'timestamp'
53
+ @_hash['customer_metadata'] = 'customer_metadata'
54
+ @_hash['data'] = 'data'
55
+ @_hash
56
+ end
57
+
58
+ # An array for optional fields
59
+ def self.optionals
60
+ %w[
61
+ customer_metadata
62
+ ]
63
+ end
64
+
65
+ # An array for nullable fields
66
+ def self.nullables
67
+ %w[
68
+ customer_metadata
69
+ ]
70
+ end
71
+
72
+ def initialize(workflow:, id:, timestamp:, data:, customer_metadata: SKIP,
73
+ additional_properties: nil)
74
+ # Add additional model properties to the instance
75
+ additional_properties = {} if additional_properties.nil?
76
+
77
+ @workflow = workflow
78
+ @id = id
79
+ @timestamp = timestamp
80
+ @customer_metadata = customer_metadata unless customer_metadata == SKIP
81
+ @data = data
82
+ @additional_properties = additional_properties
83
+ end
84
+
85
+ # Creates an instance of the object from a hash.
86
+ def self.from_hash(hash)
87
+ return nil unless hash
88
+
89
+ # Extract variables from the hash.
90
+ workflow = hash.key?('workflow') ? hash['workflow'] : nil
91
+ id = hash.key?('id') ? hash['id'] : nil
92
+ timestamp = if hash.key?('timestamp')
93
+ (DateTimeHelper.from_rfc3339(hash['timestamp']) if hash['timestamp'])
94
+ end
95
+ data = Data5.from_hash(hash['data']) if hash['data']
96
+ customer_metadata =
97
+ hash.key?('customer_metadata') ? hash['customer_metadata'] : SKIP
98
+
99
+ # Create a new hash for additional properties, removing known properties.
100
+ new_hash = hash.reject { |k, _| names.value?(k) }
101
+
102
+ additional_properties = APIHelper.get_additional_properties(
103
+ new_hash, proc { |value| value }
104
+ )
105
+
106
+ # Create object from extracted values.
107
+ BankAccountVerification.new(workflow: workflow,
108
+ id: id,
109
+ timestamp: timestamp,
110
+ data: data,
111
+ customer_metadata: customer_metadata,
112
+ additional_properties: additional_properties)
113
+ end
114
+
115
+ def to_custom_timestamp
116
+ DateTimeHelper.to_rfc3339(timestamp)
117
+ end
118
+
119
+ # Validates an instance of the object from a given value.
120
+ # @param [BankAccountVerification | Hash] The value against the validation is performed.
121
+ def self.validate(value)
122
+ if value.instance_of? self
123
+ return (
124
+ APIHelper.valid_type?(value.workflow,
125
+ ->(val) { val.instance_of? String }) and
126
+ APIHelper.valid_type?(value.id,
127
+ ->(val) { val.instance_of? String }) and
128
+ APIHelper.valid_type?(value.timestamp,
129
+ ->(val) { val.instance_of? DateTime }) and
130
+ APIHelper.valid_type?(value.data,
131
+ ->(val) { Data5.validate(val) },
132
+ is_model_hash: true)
133
+ )
134
+ end
135
+
136
+ return false unless value.instance_of? Hash
137
+
138
+ (
139
+ APIHelper.valid_type?(value['workflow'],
140
+ ->(val) { val.instance_of? String }) and
141
+ APIHelper.valid_type?(value['id'],
142
+ ->(val) { val.instance_of? String }) and
143
+ APIHelper.valid_type?(value['timestamp'],
144
+ ->(val) { val.instance_of? String }) and
145
+ APIHelper.valid_type?(value['data'],
146
+ ->(val) { Data5.validate(val) },
147
+ is_model_hash: true)
148
+ )
149
+ end
150
+
151
+ # Provides a human-readable string representation of the object.
152
+ def to_s
153
+ class_name = self.class.name.split('::').last
154
+ "<#{class_name} workflow: #{@workflow}, id: #{@id}, timestamp: #{@timestamp},"\
155
+ " customer_metadata: #{@customer_metadata}, data: #{@data}, additional_properties:"\
156
+ " #{@additional_properties}>"
157
+ end
158
+
159
+ # Provides a debugging-friendly string with detailed object information.
160
+ def inspect
161
+ class_name = self.class.name.split('::').last
162
+ "<#{class_name} workflow: #{@workflow.inspect}, id: #{@id.inspect}, timestamp:"\
163
+ " #{@timestamp.inspect}, customer_metadata: #{@customer_metadata.inspect}, data:"\
164
+ " #{@data.inspect}, additional_properties: #{@additional_properties}>"
165
+ end
166
+ end
167
+ end
@@ -0,0 +1,110 @@
1
+ # socure_risk_os_api
2
+ #
3
+ # This file was automatically generated by APIMATIC
4
+ # v3.0 ( https://www.apimatic.io ).
5
+
6
+ module SocureRiskOsApi
7
+ # Base model.
8
+ # rubocop:disable all
9
+ class BaseModel < CoreLibrary::BaseModel
10
+ # Returns a Hash representation of the current object.
11
+ def to_hash
12
+ # validating the model being serialized
13
+ self.class.validate(self) if self.class.respond_to?(:validate)
14
+
15
+ hash = {}
16
+ instance_variables.each do |name|
17
+ value = instance_variable_get(name)
18
+ name = name[1..]
19
+ if name == 'additional_properties'
20
+ additional_properties = process_additional_properties(value, self.class.names)
21
+ hash.merge!(additional_properties)
22
+ else
23
+ key = self.class.names.key?(name) ? self.class.names[name] : name
24
+ optional_fields = self.class.optionals
25
+ nullable_fields = self.class.nullables
26
+ if value.nil?
27
+ next unless nullable_fields.include?(name)
28
+
29
+ if !optional_fields.include?(name) && !nullable_fields.include?(name)
30
+ raise ArgumentError,
31
+ "`#{name}` cannot be nil in `#{self.class}`. Please specify a valid value."
32
+ end
33
+ end
34
+
35
+ hash[key] = nil
36
+ unless value.nil?
37
+ if respond_to?("to_custom_#{name}")
38
+ if (value.instance_of? Array) || (value.instance_of? Hash)
39
+ params = [hash, key]
40
+ hash[key] = send("to_custom_#{name}", *params)
41
+ else
42
+ hash[key] = send("to_custom_#{name}")
43
+ end
44
+ elsif respond_to?("to_union_type_#{name}")
45
+ hash[key] = send("to_union_type_#{name}")
46
+ elsif value.instance_of? Array
47
+ hash[key] = value.map { |v| v.is_a?(BaseModel) ? v.to_hash : v }
48
+ elsif value.instance_of? Hash
49
+ hash[key] = {}
50
+ value.each do |k, v|
51
+ hash[key][k] = v.is_a?(BaseModel) ? v.to_hash : v
52
+ end
53
+ else
54
+ hash[key] = value.is_a?(BaseModel) ? value.to_hash : value
55
+ end
56
+ end
57
+ end
58
+ end
59
+ hash
60
+ end
61
+
62
+ # Processes additional properties, ensuring no conflicts with existing properties.
63
+ def process_additional_properties(additional_properties, existing_prop_names)
64
+ hash = {}
65
+ additional_properties.each do |name, value|
66
+ check_for_conflict(name, existing_prop_names)
67
+
68
+ hash[name] = if value.is_a?(Array)
69
+ process_array(value)
70
+ elsif value.is_a?(Hash)
71
+ process_hash(value)
72
+ else
73
+ process_basic_value(value)
74
+ end
75
+ end
76
+ hash
77
+ end
78
+
79
+ # Checks if an additional property conflicts with a model's existing property.
80
+ def check_for_conflict(name, existing_prop_names)
81
+ return unless existing_prop_names.key?(name)
82
+
83
+ raise ArgumentError, "An additional property key, '#{name}' conflicts with one of the model's properties"
84
+ end
85
+
86
+ # Processes an array of values, recursively calling `to_hash` on BaseModel objects.
87
+ def process_array(value)
88
+ value.map { |v| v.is_a?(BaseModel) ? v.to_hash : v }
89
+ end
90
+
91
+ # Processes a hash of values, recursively calling `to_hash` on BaseModel objects.
92
+ def process_hash(value)
93
+ value.transform_values do |v|
94
+ v.is_a?(BaseModel) ? v.to_hash : v
95
+ end
96
+ end
97
+
98
+ # Processes a basic value (non-array, non-hash).
99
+ def process_basic_value(value)
100
+ value.is_a?(BaseModel) ? value.to_hash : value
101
+ end
102
+
103
+ # Returns a JSON representation of the curent object.
104
+ def to_json(options = {})
105
+ hash = to_hash
106
+ hash.to_json(options)
107
+ end
108
+ end
109
+ # rubocop:enable all
110
+ end