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,186 @@
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
+ # Initializes a new instance of RequestLoggingConfiguration.
8
+ class RequestLoggingConfiguration < CoreLibrary::ApiRequestLoggingConfiguration
9
+ # @param log_body [Boolean] Indicates whether the message body should be logged. Default is false.
10
+ # @param log_headers [Boolean] Indicates whether the message headers should be logged. Default is false.
11
+ # @param headers_to_exclude [Array<String>] Array of headers not displayed in logging. Default is an empty array.
12
+ # @param headers_to_include [Array<String>] Array of headers to be displayed in logging. Default is an empty array.
13
+ # @param headers_to_unmask [Array<String>] Array of headers which values are non-sensitive to display in logging.
14
+ # Default is an empty array.
15
+ def initialize(log_body: false, log_headers: false, headers_to_include: nil,
16
+ headers_to_exclude: nil, headers_to_unmask: nil,
17
+ include_query_in_path: false)
18
+ super(
19
+ log_body,
20
+ log_headers,
21
+ headers_to_exclude,
22
+ headers_to_include,
23
+ headers_to_unmask,
24
+ include_query_in_path
25
+ )
26
+ end
27
+
28
+ def clone_with(log_body: nil, log_headers: nil, headers_to_include: nil,
29
+ headers_to_exclude: nil, headers_to_unmask: nil, include_query_in_path: nil)
30
+ log_body ||= self.log_body
31
+ log_headers ||= self.log_headers
32
+ headers_to_include ||= self.headers_to_include
33
+ headers_to_exclude ||= self.headers_to_exclude
34
+ headers_to_unmask ||= self.headers_to_unmask
35
+ include_query_in_path ||= self.include_query_in_path
36
+
37
+ RequestLoggingConfiguration.new(
38
+ log_body: log_body,
39
+ log_headers: log_headers,
40
+ headers_to_include: headers_to_include,
41
+ headers_to_exclude: headers_to_exclude,
42
+ headers_to_unmask: headers_to_unmask,
43
+ include_query_in_path: include_query_in_path
44
+ )
45
+ end
46
+
47
+ def self.from_env
48
+ log_body = ENV['REQUEST_LOG_BODY']
49
+ log_headers = ENV['REQUEST_LOG_HEADERS']
50
+ headers_to_include = ENV['REQUEST_HEADERS_TO_INCLUDE']
51
+ headers_to_exclude = ENV['REQUEST_HEADERS_TO_EXCLUDE']
52
+ headers_to_unmask = ENV['REQUEST_HEADERS_TO_UNMASK']
53
+ include_query_in_path = ENV['REQUEST_INCLUDE_QUERY_IN_PATH']
54
+
55
+ new(
56
+ log_body: log_body,
57
+ log_headers: log_headers,
58
+ headers_to_include: headers_to_include,
59
+ headers_to_exclude: headers_to_exclude,
60
+ headers_to_unmask: headers_to_unmask,
61
+ include_query_in_path: include_query_in_path
62
+ )
63
+ end
64
+
65
+ def self.any_logging_configured?
66
+ %w[
67
+ REQUEST_LOG_BODY
68
+ REQUEST_LOG_HEADERS
69
+ REQUEST_HEADERS_TO_INCLUDE
70
+ REQUEST_HEADERS_TO_EXCLUDE
71
+ REQUEST_HEADERS_TO_UNMASK
72
+ REQUEST_INCLUDE_QUERY_IN_PATH
73
+ ].any? { |key| ENV.key?(key) && !ENV[key].nil? && !ENV[key].empty? }
74
+ end
75
+ end
76
+
77
+ # Initializes a new instance of ResponseLoggingConfiguration.
78
+ class ResponseLoggingConfiguration < CoreLibrary::ApiResponseLoggingConfiguration
79
+ def initialize(log_body: false, log_headers: false, headers_to_include: nil,
80
+ headers_to_exclude: nil, headers_to_unmask: nil)
81
+ super(
82
+ log_body,
83
+ log_headers,
84
+ headers_to_exclude,
85
+ headers_to_include,
86
+ headers_to_unmask
87
+ )
88
+ end
89
+
90
+ def clone_with(log_body: nil, log_headers: nil, headers_to_include: nil,
91
+ headers_to_exclude: nil, headers_to_unmask: nil)
92
+ log_body ||= self.log_body
93
+ log_headers ||= self.log_headers
94
+ headers_to_include ||= self.headers_to_include
95
+ headers_to_exclude ||= self.headers_to_exclude
96
+ headers_to_unmask ||= self.headers_to_unmask
97
+
98
+ ResponseLoggingConfiguration.new(
99
+ log_body: log_body,
100
+ log_headers: log_headers,
101
+ headers_to_include: headers_to_include,
102
+ headers_to_exclude: headers_to_exclude,
103
+ headers_to_unmask: headers_to_unmask
104
+ )
105
+ end
106
+
107
+ def self.from_env
108
+ log_body = ENV['RESPONSE_LOG_BODY']
109
+ log_headers = ENV['RESPONSE_LOG_HEADERS']
110
+ headers_to_include = ENV['RESPONSE_HEADERS_TO_INCLUDE']
111
+ headers_to_exclude = ENV['RESPONSE_HEADERS_TO_EXCLUDE']
112
+ headers_to_unmask = ENV['RESPONSE_HEADERS_TO_UNMASK']
113
+
114
+ new(
115
+ log_body: log_body,
116
+ log_headers: log_headers,
117
+ headers_to_include: headers_to_include,
118
+ headers_to_exclude: headers_to_exclude,
119
+ headers_to_unmask: headers_to_unmask
120
+ )
121
+ end
122
+
123
+ def self.any_logging_configured?
124
+ %w[
125
+ RESPONSE_LOG_BODY
126
+ RESPONSE_LOG_HEADERS
127
+ RESPONSE_HEADERS_TO_INCLUDE
128
+ RESPONSE_HEADERS_TO_EXCLUDE
129
+ RESPONSE_HEADERS_TO_UNMASK
130
+ ].any? { |key| ENV.key?(key) && !ENV[key].nil? && !ENV[key].empty? }
131
+ end
132
+ end
133
+
134
+ # Initializes a new instance of LoggingConfiguration.
135
+ class LoggingConfiguration < CoreLibrary::ApiLoggingConfiguration
136
+ def initialize(logger: nil, log_level: nil, mask_sensitive_headers: true,
137
+ request_logging_config: nil,
138
+ response_logging_config: nil)
139
+ request_logging_config ||= RequestLoggingConfiguration.new
140
+ response_logging_config ||= ResponseLoggingConfiguration.new
141
+ super(
142
+ logger,
143
+ log_level,
144
+ request_logging_config,
145
+ response_logging_config,
146
+ mask_sensitive_headers
147
+ )
148
+ end
149
+
150
+ def clone_with(logger: nil, log_level: nil, mask_sensitive_headers: nil,
151
+ request_logging_config: nil, response_logging_config: nil)
152
+ logger ||= self.logger
153
+ log_level ||= self.log_level
154
+ mask_sensitive_headers ||= self.mask_sensitive_headers
155
+ request_logging_config ||= self.request_logging_config.clone
156
+ response_logging_config ||= self.response_logging_config.clone
157
+
158
+ LoggingConfiguration.new(
159
+ logger: logger,
160
+ log_level: log_level,
161
+ mask_sensitive_headers: mask_sensitive_headers,
162
+ request_logging_config: request_logging_config,
163
+ response_logging_config: response_logging_config
164
+ )
165
+ end
166
+
167
+ def self.from_env
168
+ log_level = ENV['LOG_LEVEL']
169
+ mask_sensitive_headers = ENV['MASK_SENSITIVE_HEADERS']
170
+
171
+ new(
172
+ log_level: log_level,
173
+ mask_sensitive_headers: mask_sensitive_headers,
174
+ request_logging_config: RequestLoggingConfiguration.from_env,
175
+ response_logging_config: ResponseLoggingConfiguration.from_env
176
+ )
177
+ end
178
+
179
+ def self.any_logging_configured?
180
+ RequestLoggingConfiguration.any_logging_configured? ||
181
+ ResponseLoggingConfiguration.any_logging_configured? ||
182
+ ENV.key?('LOG_LEVEL') ||
183
+ ENV.key?('MASK_SENSITIVE_HEADERS')
184
+ end
185
+ end
186
+ end
@@ -0,0 +1,17 @@
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
+ # Represents the generic logger facade
8
+ class AbstractLogger < Logger
9
+ # Logs a message with a specified log level and additional parameters.
10
+ # @param level [Symbol] The log level of the message.
11
+ # @param message [String] The message to log.
12
+ # @param params [Hash] Additional parameters to include in the log message.
13
+ def log(level, message, params)
14
+ raise NotImplementedError, 'This method needs to be implemented in a child class.'
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,206 @@
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
+ # Defines the schema of an bank account.
9
+ class Account < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Account Type
14
+ # @return [Type]
15
+ attr_accessor :type
16
+
17
+ # Bank account number
18
+ # @return [String]
19
+ attr_accessor :account_number
20
+
21
+ # Routing number associated with the account
22
+ # @return [String]
23
+ attr_accessor :routing_number
24
+
25
+ # Swift/BIC Code of the account
26
+ # @return [String]
27
+ attr_accessor :swift_bic
28
+
29
+ # ISO 8601/ RFC 3339 date-time. Date the account was opened.
30
+ # @return [DateTime]
31
+ attr_accessor :opened_at
32
+
33
+ # Name of the institution (e.g. XYZ bank)
34
+ # @return [String]
35
+ attr_accessor :institution_name
36
+
37
+ # Client provided unique Account ID.
38
+ # @return [String]
39
+ attr_accessor :id
40
+
41
+ # Client provided unique Account ID.
42
+ # @return [Address]
43
+ attr_accessor :institution_address
44
+
45
+ # The inquiry type. Below are the possible values.
46
+ # - `AVAILABILITY`: Used to confirm a bank account's availability.
47
+ # - `OWNERSHIP`: Used to verify a bank account's ownership.
48
+ # @return [Array[Inquiry]]
49
+ attr_accessor :account_inquiries
50
+
51
+ # Represents a snapshot of the account’s state at a specific point in time.
52
+ # @return [AccountSnapshot]
53
+ attr_accessor :account_snapshot
54
+
55
+ # Send any additional, customer-specific data in this field. See [Custom
56
+ # Fields](https://help.socure.com/riskos/docs/custom-fields) for more
57
+ # information.
58
+ # @return [Hash[String, Object]]
59
+ attr_accessor :custom
60
+
61
+ # A mapping from model property names to API property names.
62
+ def self.names
63
+ @_hash = {} if @_hash.nil?
64
+ @_hash['type'] = 'type'
65
+ @_hash['account_number'] = 'account_number'
66
+ @_hash['routing_number'] = 'routing_number'
67
+ @_hash['swift_bic'] = 'swift_bic'
68
+ @_hash['opened_at'] = 'opened_at'
69
+ @_hash['institution_name'] = 'institution_name'
70
+ @_hash['id'] = 'id'
71
+ @_hash['institution_address'] = 'institution_address'
72
+ @_hash['account_inquiries'] = 'account_inquiries'
73
+ @_hash['account_snapshot'] = 'account_snapshot'
74
+ @_hash['custom'] = 'custom'
75
+ @_hash
76
+ end
77
+
78
+ # An array for optional fields
79
+ def self.optionals
80
+ %w[
81
+ type
82
+ account_number
83
+ routing_number
84
+ swift_bic
85
+ opened_at
86
+ institution_name
87
+ id
88
+ institution_address
89
+ account_inquiries
90
+ account_snapshot
91
+ custom
92
+ ]
93
+ end
94
+
95
+ # An array for nullable fields
96
+ def self.nullables
97
+ []
98
+ end
99
+
100
+ def initialize(type: SKIP, account_number: SKIP, routing_number: SKIP,
101
+ swift_bic: SKIP, opened_at: SKIP, institution_name: SKIP,
102
+ id: SKIP, institution_address: SKIP, account_inquiries: SKIP,
103
+ account_snapshot: SKIP, custom: SKIP,
104
+ additional_properties: nil)
105
+ # Add additional model properties to the instance
106
+ additional_properties = {} if additional_properties.nil?
107
+
108
+ @type = type unless type == SKIP
109
+ @account_number = account_number unless account_number == SKIP
110
+ @routing_number = routing_number unless routing_number == SKIP
111
+ @swift_bic = swift_bic unless swift_bic == SKIP
112
+ @opened_at = opened_at unless opened_at == SKIP
113
+ @institution_name = institution_name unless institution_name == SKIP
114
+ @id = id unless id == SKIP
115
+ @institution_address = institution_address unless institution_address == SKIP
116
+ @account_inquiries = account_inquiries unless account_inquiries == SKIP
117
+ @account_snapshot = account_snapshot unless account_snapshot == SKIP
118
+ @custom = custom unless custom == SKIP
119
+ @additional_properties = additional_properties
120
+ end
121
+
122
+ # Creates an instance of the object from a hash.
123
+ def self.from_hash(hash)
124
+ return nil unless hash
125
+
126
+ # Extract variables from the hash.
127
+ type = hash.key?('type') ? hash['type'] : SKIP
128
+ account_number =
129
+ hash.key?('account_number') ? hash['account_number'] : SKIP
130
+ routing_number =
131
+ hash.key?('routing_number') ? hash['routing_number'] : SKIP
132
+ swift_bic = hash.key?('swift_bic') ? hash['swift_bic'] : SKIP
133
+ opened_at = if hash.key?('opened_at')
134
+ (DateTimeHelper.from_rfc3339(hash['opened_at']) if hash['opened_at'])
135
+ else
136
+ SKIP
137
+ end
138
+ institution_name =
139
+ hash.key?('institution_name') ? hash['institution_name'] : SKIP
140
+ id = hash.key?('id') ? hash['id'] : SKIP
141
+ institution_address = Address.from_hash(hash['institution_address']) if
142
+ hash['institution_address']
143
+ account_inquiries =
144
+ hash.key?('account_inquiries') ? hash['account_inquiries'] : SKIP
145
+ account_snapshot = AccountSnapshot.from_hash(hash['account_snapshot']) if
146
+ hash['account_snapshot']
147
+ custom = hash.key?('custom') ? hash['custom'] : SKIP
148
+
149
+ # Create a new hash for additional properties, removing known properties.
150
+ new_hash = hash.reject { |k, _| names.value?(k) }
151
+
152
+ additional_properties = APIHelper.get_additional_properties(
153
+ new_hash, proc { |value| value }
154
+ )
155
+
156
+ # Create object from extracted values.
157
+ Account.new(type: type,
158
+ account_number: account_number,
159
+ routing_number: routing_number,
160
+ swift_bic: swift_bic,
161
+ opened_at: opened_at,
162
+ institution_name: institution_name,
163
+ id: id,
164
+ institution_address: institution_address,
165
+ account_inquiries: account_inquiries,
166
+ account_snapshot: account_snapshot,
167
+ custom: custom,
168
+ additional_properties: additional_properties)
169
+ end
170
+
171
+ def to_custom_opened_at
172
+ DateTimeHelper.to_rfc3339(opened_at)
173
+ end
174
+
175
+ # Validates an instance of the object from a given value.
176
+ # @param [Account | Hash] The value against the validation is performed.
177
+ def self.validate(value)
178
+ return true if value.instance_of? self
179
+
180
+ return false unless value.instance_of? Hash
181
+
182
+ true
183
+ end
184
+
185
+ # Provides a human-readable string representation of the object.
186
+ def to_s
187
+ class_name = self.class.name.split('::').last
188
+ "<#{class_name} type: #{@type}, account_number: #{@account_number}, routing_number:"\
189
+ " #{@routing_number}, swift_bic: #{@swift_bic}, opened_at: #{@opened_at}, institution_name:"\
190
+ " #{@institution_name}, id: #{@id}, institution_address: #{@institution_address},"\
191
+ " account_inquiries: #{@account_inquiries}, account_snapshot: #{@account_snapshot}, custom:"\
192
+ " #{@custom}, additional_properties: #{@additional_properties}>"
193
+ end
194
+
195
+ # Provides a debugging-friendly string with detailed object information.
196
+ def inspect
197
+ class_name = self.class.name.split('::').last
198
+ "<#{class_name} type: #{@type.inspect}, account_number: #{@account_number.inspect},"\
199
+ " routing_number: #{@routing_number.inspect}, swift_bic: #{@swift_bic.inspect}, opened_at:"\
200
+ " #{@opened_at.inspect}, institution_name: #{@institution_name.inspect}, id: #{@id.inspect},"\
201
+ " institution_address: #{@institution_address.inspect}, account_inquiries:"\
202
+ " #{@account_inquiries.inspect}, account_snapshot: #{@account_snapshot.inspect}, custom:"\
203
+ " #{@custom.inspect}, additional_properties: #{@additional_properties}>"
204
+ end
205
+ end
206
+ end
@@ -0,0 +1,203 @@
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
+ # Bank account details. Required when `type` is `BANK_ACCOUNT`.
9
+ class Account1 < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Client-provided unique account identifier.
14
+ # @return [String]
15
+ attr_accessor :id
16
+
17
+ # Bank account type.
18
+ # @return [Type2]
19
+ attr_accessor :type
20
+
21
+ # Bank account number.
22
+ # @return [String]
23
+ attr_accessor :account_number
24
+
25
+ # Routing number associated with the account.
26
+ # @return [String]
27
+ attr_accessor :routing_number
28
+
29
+ # SWIFT/BIC code.
30
+ # @return [String]
31
+ attr_accessor :swift_bic
32
+
33
+ # International Bank Account Number (IBAN).
34
+ # @return [String]
35
+ attr_accessor :iban
36
+
37
+ # Date and time the account was opened, in ISO 8601 / RFC 3339 format.
38
+ # @return [DateTime]
39
+ attr_accessor :opened_at
40
+
41
+ # Financial institution name.
42
+ # @return [String]
43
+ attr_accessor :institution_name
44
+
45
+ # Inquiry types requested for the account.
46
+ # @return [Array[AccountInquiry]]
47
+ attr_accessor :account_inquiries
48
+
49
+ # Inquiry types requested for the account.
50
+ # @return [Address]
51
+ attr_accessor :institution_address
52
+
53
+ # Represents a snapshot of the account’s state at a specific point in time.
54
+ # @return [AccountSnapshot]
55
+ attr_accessor :account_snapshot
56
+
57
+ # A mapping from model property names to API property names.
58
+ def self.names
59
+ @_hash = {} if @_hash.nil?
60
+ @_hash['id'] = 'id'
61
+ @_hash['type'] = 'type'
62
+ @_hash['account_number'] = 'account_number'
63
+ @_hash['routing_number'] = 'routing_number'
64
+ @_hash['swift_bic'] = 'swift_bic'
65
+ @_hash['iban'] = 'iban'
66
+ @_hash['opened_at'] = 'opened_at'
67
+ @_hash['institution_name'] = 'institution_name'
68
+ @_hash['account_inquiries'] = 'account_inquiries'
69
+ @_hash['institution_address'] = 'institution_address'
70
+ @_hash['account_snapshot'] = 'account_snapshot'
71
+ @_hash
72
+ end
73
+
74
+ # An array for optional fields
75
+ def self.optionals
76
+ %w[
77
+ id
78
+ type
79
+ account_number
80
+ routing_number
81
+ swift_bic
82
+ iban
83
+ opened_at
84
+ institution_name
85
+ account_inquiries
86
+ institution_address
87
+ account_snapshot
88
+ ]
89
+ end
90
+
91
+ # An array for nullable fields
92
+ def self.nullables
93
+ []
94
+ end
95
+
96
+ def initialize(id: SKIP, type: SKIP, account_number: SKIP,
97
+ routing_number: SKIP, swift_bic: SKIP, iban: SKIP,
98
+ opened_at: SKIP, institution_name: SKIP,
99
+ account_inquiries: SKIP, institution_address: SKIP,
100
+ account_snapshot: SKIP, additional_properties: nil)
101
+ # Add additional model properties to the instance
102
+ additional_properties = {} if additional_properties.nil?
103
+
104
+ @id = id unless id == SKIP
105
+ @type = type unless type == SKIP
106
+ @account_number = account_number unless account_number == SKIP
107
+ @routing_number = routing_number unless routing_number == SKIP
108
+ @swift_bic = swift_bic unless swift_bic == SKIP
109
+ @iban = iban unless iban == SKIP
110
+ @opened_at = opened_at unless opened_at == SKIP
111
+ @institution_name = institution_name unless institution_name == SKIP
112
+ @account_inquiries = account_inquiries unless account_inquiries == SKIP
113
+ @institution_address = institution_address unless institution_address == SKIP
114
+ @account_snapshot = account_snapshot unless account_snapshot == SKIP
115
+ @additional_properties = additional_properties
116
+ end
117
+
118
+ # Creates an instance of the object from a hash.
119
+ def self.from_hash(hash)
120
+ return nil unless hash
121
+
122
+ # Extract variables from the hash.
123
+ id = hash.key?('id') ? hash['id'] : SKIP
124
+ type = hash.key?('type') ? hash['type'] : SKIP
125
+ account_number =
126
+ hash.key?('account_number') ? hash['account_number'] : SKIP
127
+ routing_number =
128
+ hash.key?('routing_number') ? hash['routing_number'] : SKIP
129
+ swift_bic = hash.key?('swift_bic') ? hash['swift_bic'] : SKIP
130
+ iban = hash.key?('iban') ? hash['iban'] : SKIP
131
+ opened_at = if hash.key?('opened_at')
132
+ (DateTimeHelper.from_rfc3339(hash['opened_at']) if hash['opened_at'])
133
+ else
134
+ SKIP
135
+ end
136
+ institution_name =
137
+ hash.key?('institution_name') ? hash['institution_name'] : SKIP
138
+ account_inquiries =
139
+ hash.key?('account_inquiries') ? hash['account_inquiries'] : SKIP
140
+ institution_address = Address.from_hash(hash['institution_address']) if
141
+ hash['institution_address']
142
+ account_snapshot = AccountSnapshot.from_hash(hash['account_snapshot']) if
143
+ hash['account_snapshot']
144
+
145
+ # Create a new hash for additional properties, removing known properties.
146
+ new_hash = hash.reject { |k, _| names.value?(k) }
147
+
148
+ additional_properties = APIHelper.get_additional_properties(
149
+ new_hash, proc { |value| value }
150
+ )
151
+
152
+ # Create object from extracted values.
153
+ Account1.new(id: id,
154
+ type: type,
155
+ account_number: account_number,
156
+ routing_number: routing_number,
157
+ swift_bic: swift_bic,
158
+ iban: iban,
159
+ opened_at: opened_at,
160
+ institution_name: institution_name,
161
+ account_inquiries: account_inquiries,
162
+ institution_address: institution_address,
163
+ account_snapshot: account_snapshot,
164
+ additional_properties: additional_properties)
165
+ end
166
+
167
+ def to_custom_opened_at
168
+ DateTimeHelper.to_rfc3339(opened_at)
169
+ end
170
+
171
+ # Validates an instance of the object from a given value.
172
+ # @param [Account1 | Hash] The value against the validation is performed.
173
+ def self.validate(value)
174
+ return true if value.instance_of? self
175
+
176
+ return false unless value.instance_of? Hash
177
+
178
+ true
179
+ end
180
+
181
+ # Provides a human-readable string representation of the object.
182
+ def to_s
183
+ class_name = self.class.name.split('::').last
184
+ "<#{class_name} id: #{@id}, type: #{@type}, account_number: #{@account_number},"\
185
+ " routing_number: #{@routing_number}, swift_bic: #{@swift_bic}, iban: #{@iban}, opened_at:"\
186
+ " #{@opened_at}, institution_name: #{@institution_name}, account_inquiries:"\
187
+ " #{@account_inquiries}, institution_address: #{@institution_address}, account_snapshot:"\
188
+ " #{@account_snapshot}, additional_properties: #{@additional_properties}>"
189
+ end
190
+
191
+ # Provides a debugging-friendly string with detailed object information.
192
+ def inspect
193
+ class_name = self.class.name.split('::').last
194
+ "<#{class_name} id: #{@id.inspect}, type: #{@type.inspect}, account_number:"\
195
+ " #{@account_number.inspect}, routing_number: #{@routing_number.inspect}, swift_bic:"\
196
+ " #{@swift_bic.inspect}, iban: #{@iban.inspect}, opened_at: #{@opened_at.inspect},"\
197
+ " institution_name: #{@institution_name.inspect}, account_inquiries:"\
198
+ " #{@account_inquiries.inspect}, institution_address: #{@institution_address.inspect},"\
199
+ " account_snapshot: #{@account_snapshot.inspect}, additional_properties:"\
200
+ " #{@additional_properties}>"
201
+ end
202
+ end
203
+ end
@@ -0,0 +1,36 @@
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
+ # AccountInquiry.
8
+ class AccountInquiry
9
+ ACCOUNT_INQUIRY = [
10
+ # TODO: Write general description for AVAILABILITY
11
+ AVAILABILITY = 'AVAILABILITY'.freeze,
12
+
13
+ # TODO: Write general description for OWNERSHIP
14
+ OWNERSHIP = 'OWNERSHIP'.freeze
15
+ ].freeze
16
+
17
+ def self.validate(value)
18
+ return false if value.nil?
19
+
20
+ ACCOUNT_INQUIRY.include?(value)
21
+ end
22
+
23
+ def self.from_value(value, default_value = AVAILABILITY)
24
+ return default_value if value.nil?
25
+
26
+ str = value.to_s.strip
27
+
28
+ case str.downcase
29
+ when 'availability' then AVAILABILITY
30
+ when 'ownership' then OWNERSHIP
31
+ else
32
+ default_value
33
+ end
34
+ end
35
+ end
36
+ end