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,96 @@
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
+ # Contextual details about the specific event, such as previous and updated
8
+ # state values.
9
+ class EventDetails < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Data reflecting the state prior to the update.
14
+ # @return [Object]
15
+ attr_accessor :previous
16
+
17
+ # Data reflecting the new state after the update.
18
+ # @return [Object]
19
+ attr_accessor :updated
20
+
21
+ # A mapping from model property names to API property names.
22
+ def self.names
23
+ @_hash = {} if @_hash.nil?
24
+ @_hash['previous'] = 'previous'
25
+ @_hash['updated'] = 'updated'
26
+ @_hash
27
+ end
28
+
29
+ # An array for optional fields
30
+ def self.optionals
31
+ %w[
32
+ previous
33
+ updated
34
+ ]
35
+ end
36
+
37
+ # An array for nullable fields
38
+ def self.nullables
39
+ []
40
+ end
41
+
42
+ def initialize(previous: SKIP, updated: SKIP, additional_properties: nil)
43
+ # Add additional model properties to the instance
44
+ additional_properties = {} if additional_properties.nil?
45
+
46
+ @previous = previous unless previous == SKIP
47
+ @updated = updated unless updated == SKIP
48
+ @additional_properties = additional_properties
49
+ end
50
+
51
+ # Creates an instance of the object from a hash.
52
+ def self.from_hash(hash)
53
+ return nil unless hash
54
+
55
+ # Extract variables from the hash.
56
+ previous = hash.key?('previous') ? hash['previous'] : SKIP
57
+ updated = hash.key?('updated') ? hash['updated'] : SKIP
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
+ EventDetails.new(previous: previous,
68
+ updated: updated,
69
+ additional_properties: additional_properties)
70
+ end
71
+
72
+ # Validates an instance of the object from a given value.
73
+ # @param [EventDetails | Hash] The value against the validation is performed.
74
+ def self.validate(value)
75
+ return true if value.instance_of? self
76
+
77
+ return false unless value.instance_of? Hash
78
+
79
+ true
80
+ end
81
+
82
+ # Provides a human-readable string representation of the object.
83
+ def to_s
84
+ class_name = self.class.name.split('::').last
85
+ "<#{class_name} previous: #{@previous}, updated: #{@updated}, additional_properties:"\
86
+ " #{@additional_properties}>"
87
+ end
88
+
89
+ # Provides a debugging-friendly string with detailed object information.
90
+ def inspect
91
+ class_name = self.class.name.split('::').last
92
+ "<#{class_name} previous: #{@previous.inspect}, updated: #{@updated.inspect},"\
93
+ " additional_properties: #{@additional_properties}>"
94
+ end
95
+ end
96
+ end
@@ -0,0 +1,138 @@
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
+ # Formation Model.
8
+ class Formation < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Legal structure of the business. Free-form string; no fixed set of values
13
+ # is enforced. For best business verification results, send a standard legal
14
+ # entity type such as `CORPORATION`, `LLC`, `SOLE_PROPRIETOR`, or
15
+ # `PARTNERSHIP`.
16
+ # @return [String]
17
+ attr_accessor :entity_type
18
+
19
+ # YYYY-MM-DD RFC 3339 date string
20
+ # @return [Date]
21
+ attr_accessor :registration_date
22
+
23
+ # State of registration
24
+ # @return [String]
25
+ attr_accessor :registration_state
26
+
27
+ # Country of registration
28
+ # @return [String]
29
+ attr_accessor :registration_country
30
+
31
+ # A mapping from model property names to API property names.
32
+ def self.names
33
+ @_hash = {} if @_hash.nil?
34
+ @_hash['entity_type'] = 'entity_type'
35
+ @_hash['registration_date'] = 'registration_date'
36
+ @_hash['registration_state'] = 'registration_state'
37
+ @_hash['registration_country'] = 'registration_country'
38
+ @_hash
39
+ end
40
+
41
+ # An array for optional fields
42
+ def self.optionals
43
+ []
44
+ end
45
+
46
+ # An array for nullable fields
47
+ def self.nullables
48
+ []
49
+ end
50
+
51
+ def initialize(entity_type:, registration_date:, registration_state:,
52
+ registration_country:, additional_properties: nil)
53
+ # Add additional model properties to the instance
54
+ additional_properties = {} if additional_properties.nil?
55
+
56
+ @entity_type = entity_type
57
+ @registration_date = registration_date
58
+ @registration_state = registration_state
59
+ @registration_country = registration_country
60
+ @additional_properties = additional_properties
61
+ end
62
+
63
+ # Creates an instance of the object from a hash.
64
+ def self.from_hash(hash)
65
+ return nil unless hash
66
+
67
+ # Extract variables from the hash.
68
+ entity_type = hash.key?('entity_type') ? hash['entity_type'] : nil
69
+ registration_date =
70
+ hash.key?('registration_date') ? hash['registration_date'] : nil
71
+ registration_state =
72
+ hash.key?('registration_state') ? hash['registration_state'] : nil
73
+ registration_country =
74
+ hash.key?('registration_country') ? hash['registration_country'] : nil
75
+
76
+ # Create a new hash for additional properties, removing known properties.
77
+ new_hash = hash.reject { |k, _| names.value?(k) }
78
+
79
+ additional_properties = APIHelper.get_additional_properties(
80
+ new_hash, proc { |value| value }
81
+ )
82
+
83
+ # Create object from extracted values.
84
+ Formation.new(entity_type: entity_type,
85
+ registration_date: registration_date,
86
+ registration_state: registration_state,
87
+ registration_country: registration_country,
88
+ additional_properties: additional_properties)
89
+ end
90
+
91
+ # Validates an instance of the object from a given value.
92
+ # @param [Formation | Hash] The value against the validation is performed.
93
+ def self.validate(value)
94
+ if value.instance_of? self
95
+ return (
96
+ APIHelper.valid_type?(value.entity_type,
97
+ ->(val) { val.instance_of? String }) and
98
+ APIHelper.valid_type?(value.registration_date,
99
+ ->(val) { val.instance_of? String }) and
100
+ APIHelper.valid_type?(value.registration_state,
101
+ ->(val) { val.instance_of? String }) and
102
+ APIHelper.valid_type?(value.registration_country,
103
+ ->(val) { val.instance_of? String })
104
+ )
105
+ end
106
+
107
+ return false unless value.instance_of? Hash
108
+
109
+ (
110
+ APIHelper.valid_type?(value['entity_type'],
111
+ ->(val) { val.instance_of? String }) and
112
+ APIHelper.valid_type?(value['registration_date'],
113
+ ->(val) { val.instance_of? String }) and
114
+ APIHelper.valid_type?(value['registration_state'],
115
+ ->(val) { val.instance_of? String }) and
116
+ APIHelper.valid_type?(value['registration_country'],
117
+ ->(val) { val.instance_of? String })
118
+ )
119
+ end
120
+
121
+ # Provides a human-readable string representation of the object.
122
+ def to_s
123
+ class_name = self.class.name.split('::').last
124
+ "<#{class_name} entity_type: #{@entity_type}, registration_date: #{@registration_date},"\
125
+ " registration_state: #{@registration_state}, registration_country:"\
126
+ " #{@registration_country}, additional_properties: #{@additional_properties}>"
127
+ end
128
+
129
+ # Provides a debugging-friendly string with detailed object information.
130
+ def inspect
131
+ class_name = self.class.name.split('::').last
132
+ "<#{class_name} entity_type: #{@entity_type.inspect}, registration_date:"\
133
+ " #{@registration_date.inspect}, registration_state: #{@registration_state.inspect},"\
134
+ " registration_country: #{@registration_country.inspect}, additional_properties:"\
135
+ " #{@additional_properties}>"
136
+ end
137
+ end
138
+ end
@@ -0,0 +1,73 @@
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
+ # FraudFeedbackImportResponse Model.
8
+ class FraudFeedbackImportResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :message
15
+
16
+ # A mapping from model property names to API property names.
17
+ def self.names
18
+ @_hash = {} if @_hash.nil?
19
+ @_hash['message'] = 'message'
20
+ @_hash
21
+ end
22
+
23
+ # An array for optional fields
24
+ def self.optionals
25
+ []
26
+ end
27
+
28
+ # An array for nullable fields
29
+ def self.nullables
30
+ []
31
+ end
32
+
33
+ def initialize(message:, additional_properties: nil)
34
+ # Add additional model properties to the instance
35
+ additional_properties = {} if additional_properties.nil?
36
+
37
+ @message = message
38
+ @additional_properties = additional_properties
39
+ end
40
+
41
+ # Creates an instance of the object from a hash.
42
+ def self.from_hash(hash)
43
+ return nil unless hash
44
+
45
+ # Extract variables from the hash.
46
+ message = hash.key?('message') ? hash['message'] : nil
47
+
48
+ # Create a new hash for additional properties, removing known properties.
49
+ new_hash = hash.reject { |k, _| names.value?(k) }
50
+
51
+ additional_properties = APIHelper.get_additional_properties(
52
+ new_hash, proc { |value| value }
53
+ )
54
+
55
+ # Create object from extracted values.
56
+ FraudFeedbackImportResponse.new(message: message,
57
+ additional_properties: additional_properties)
58
+ end
59
+
60
+ # Provides a human-readable string representation of the object.
61
+ def to_s
62
+ class_name = self.class.name.split('::').last
63
+ "<#{class_name} message: #{@message}, additional_properties: #{@additional_properties}>"
64
+ end
65
+
66
+ # Provides a debugging-friendly string with detailed object information.
67
+ def inspect
68
+ class_name = self.class.name.split('::').last
69
+ "<#{class_name} message: #{@message.inspect}, additional_properties:"\
70
+ " #{@additional_properties}>"
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,73 @@
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
+ # FraudFeedbackResponse Model.
8
+ class FraudFeedbackResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :message
15
+
16
+ # A mapping from model property names to API property names.
17
+ def self.names
18
+ @_hash = {} if @_hash.nil?
19
+ @_hash['message'] = 'message'
20
+ @_hash
21
+ end
22
+
23
+ # An array for optional fields
24
+ def self.optionals
25
+ []
26
+ end
27
+
28
+ # An array for nullable fields
29
+ def self.nullables
30
+ []
31
+ end
32
+
33
+ def initialize(message:, additional_properties: nil)
34
+ # Add additional model properties to the instance
35
+ additional_properties = {} if additional_properties.nil?
36
+
37
+ @message = message
38
+ @additional_properties = additional_properties
39
+ end
40
+
41
+ # Creates an instance of the object from a hash.
42
+ def self.from_hash(hash)
43
+ return nil unless hash
44
+
45
+ # Extract variables from the hash.
46
+ message = hash.key?('message') ? hash['message'] : nil
47
+
48
+ # Create a new hash for additional properties, removing known properties.
49
+ new_hash = hash.reject { |k, _| names.value?(k) }
50
+
51
+ additional_properties = APIHelper.get_additional_properties(
52
+ new_hash, proc { |value| value }
53
+ )
54
+
55
+ # Create object from extracted values.
56
+ FraudFeedbackResponse.new(message: message,
57
+ additional_properties: additional_properties)
58
+ end
59
+
60
+ # Provides a human-readable string representation of the object.
61
+ def to_s
62
+ class_name = self.class.name.split('::').last
63
+ "<#{class_name} message: #{@message}, additional_properties: #{@additional_properties}>"
64
+ end
65
+
66
+ # Provides a debugging-friendly string with detailed object information.
67
+ def inspect
68
+ class_name = self.class.name.split('::').last
69
+ "<#{class_name} message: #{@message.inspect}, additional_properties:"\
70
+ " #{@additional_properties}>"
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,37 @@
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
+ # The fraud label for an application. Accepted values are `fraud` and
8
+ # `non-fraud`.
9
+ class FraudLabel
10
+ FRAUD_LABEL = [
11
+ # TODO: Write general description for FRAUD
12
+ FRAUD = 'fraud'.freeze,
13
+
14
+ # TODO: Write general description for NONFRAUD
15
+ NONFRAUD = 'non-fraud'.freeze
16
+ ].freeze
17
+
18
+ def self.validate(value)
19
+ return false if value.nil?
20
+
21
+ FRAUD_LABEL.include?(value)
22
+ end
23
+
24
+ def self.from_value(value, default_value = FRAUD)
25
+ return default_value if value.nil?
26
+
27
+ str = value.to_s.strip
28
+
29
+ case str.downcase
30
+ when 'fraud' then FRAUD
31
+ when 'nonfraud' then NONFRAUD
32
+ else
33
+ default_value
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,40 @@
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
+ # The consumer's gender.
8
+ class Gender
9
+ GENDER = [
10
+ # TODO: Write general description for MALE
11
+ MALE = 'Male'.freeze,
12
+
13
+ # TODO: Write general description for FEMALE
14
+ FEMALE = 'Female'.freeze,
15
+
16
+ # TODO: Write general description for ENUM_SELF_IDENTIFY
17
+ ENUM_SELF_IDENTIFY = 'Self Identify'.freeze
18
+ ].freeze
19
+
20
+ def self.validate(value)
21
+ return false if value.nil?
22
+
23
+ GENDER.include?(value)
24
+ end
25
+
26
+ def self.from_value(value, default_value = MALE)
27
+ return default_value if value.nil?
28
+
29
+ str = value.to_s.strip
30
+
31
+ case str.downcase
32
+ when 'male' then MALE
33
+ when 'female' then FEMALE
34
+ when 'enum_self_identify' then ENUM_SELF_IDENTIFY
35
+ else
36
+ default_value
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,169 @@
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
+ # Schema for a generic pass-through evaluation flow. Typically used when the
9
+ # goal is to retrieve Socure module data without applying a full risk
10
+ # evaluation.
11
+ class GenericPassthrough < BaseModel
12
+ SKIP = Object.new
13
+ private_constant :SKIP
14
+
15
+ # Your environment-specific workflow identifier. You can find this value in
16
+ # the RiskOS™ Dashboard > Developer Workbench > Integration Checklist. <br
17
+ # /><br /> **Note:** The workflow name must be unique within your RiskOS™
18
+ # environment. It is not scoped by use case and must identify a single
19
+ # active workflow for each Evaluation API request.
20
+ # @return [String]
21
+ attr_accessor :workflow
22
+
23
+ # Required, customer-defined unique identifier for the request. <br /><br />
24
+ # This value must be unique for each evaluation. Reusing an ID causes
25
+ # RiskOS™ to treat the request as a re-run and can impact processing
26
+ # behavior, results, and downstream workflows.
27
+ # @return [String]
28
+ attr_accessor :id
29
+
30
+ # The timestamp indicating when the evaluation was initiated, in ISO 8601 /
31
+ # RFC 3339 format.
32
+ # @return [DateTime]
33
+ attr_accessor :timestamp
34
+
35
+ # Optional, opaque JSON object echoed back unchanged on the response and at
36
+ # the top level of webhook callbacks — use it to route and correlate
37
+ # requests. Must be a JSON object of up to 200 characters total (the entire
38
+ # serialized JSON); larger payloads return `413
39
+ # CUSTOMER_METADATA_TOO_LARGE`. Omit it or send `null` to skip. Don't
40
+ # include PII or secrets. See [Customer
41
+ # Metadata](https://help.socure.com/riskos/docs/customer-metadata).
42
+ # @return [Object]
43
+ attr_accessor :customer_metadata
44
+
45
+ # The main payload for the Pass-Through workflow.
46
+ # @return [Data3]
47
+ attr_accessor :data
48
+
49
+ # A mapping from model property names to API property names.
50
+ def self.names
51
+ @_hash = {} if @_hash.nil?
52
+ @_hash['workflow'] = 'workflow'
53
+ @_hash['id'] = 'id'
54
+ @_hash['timestamp'] = 'timestamp'
55
+ @_hash['customer_metadata'] = 'customer_metadata'
56
+ @_hash['data'] = 'data'
57
+ @_hash
58
+ end
59
+
60
+ # An array for optional fields
61
+ def self.optionals
62
+ %w[
63
+ customer_metadata
64
+ ]
65
+ end
66
+
67
+ # An array for nullable fields
68
+ def self.nullables
69
+ %w[
70
+ customer_metadata
71
+ ]
72
+ end
73
+
74
+ def initialize(workflow:, id:, timestamp:, data:, customer_metadata: SKIP,
75
+ additional_properties: nil)
76
+ # Add additional model properties to the instance
77
+ additional_properties = {} if additional_properties.nil?
78
+
79
+ @workflow = workflow
80
+ @id = id
81
+ @timestamp = timestamp
82
+ @customer_metadata = customer_metadata unless customer_metadata == SKIP
83
+ @data = data
84
+ @additional_properties = additional_properties
85
+ end
86
+
87
+ # Creates an instance of the object from a hash.
88
+ def self.from_hash(hash)
89
+ return nil unless hash
90
+
91
+ # Extract variables from the hash.
92
+ workflow = hash.key?('workflow') ? hash['workflow'] : nil
93
+ id = hash.key?('id') ? hash['id'] : nil
94
+ timestamp = if hash.key?('timestamp')
95
+ (DateTimeHelper.from_rfc3339(hash['timestamp']) if hash['timestamp'])
96
+ end
97
+ data = Data3.from_hash(hash['data']) if hash['data']
98
+ customer_metadata =
99
+ hash.key?('customer_metadata') ? hash['customer_metadata'] : SKIP
100
+
101
+ # Create a new hash for additional properties, removing known properties.
102
+ new_hash = hash.reject { |k, _| names.value?(k) }
103
+
104
+ additional_properties = APIHelper.get_additional_properties(
105
+ new_hash, proc { |value| value }
106
+ )
107
+
108
+ # Create object from extracted values.
109
+ GenericPassthrough.new(workflow: workflow,
110
+ id: id,
111
+ timestamp: timestamp,
112
+ data: data,
113
+ customer_metadata: customer_metadata,
114
+ additional_properties: additional_properties)
115
+ end
116
+
117
+ def to_custom_timestamp
118
+ DateTimeHelper.to_rfc3339(timestamp)
119
+ end
120
+
121
+ # Validates an instance of the object from a given value.
122
+ # @param [GenericPassthrough | Hash] The value against the validation is performed.
123
+ def self.validate(value)
124
+ if value.instance_of? self
125
+ return (
126
+ APIHelper.valid_type?(value.workflow,
127
+ ->(val) { val.instance_of? String }) and
128
+ APIHelper.valid_type?(value.id,
129
+ ->(val) { val.instance_of? String }) and
130
+ APIHelper.valid_type?(value.timestamp,
131
+ ->(val) { val.instance_of? DateTime }) and
132
+ APIHelper.valid_type?(value.data,
133
+ ->(val) { Data3.validate(val) },
134
+ is_model_hash: true)
135
+ )
136
+ end
137
+
138
+ return false unless value.instance_of? Hash
139
+
140
+ (
141
+ APIHelper.valid_type?(value['workflow'],
142
+ ->(val) { val.instance_of? String }) and
143
+ APIHelper.valid_type?(value['id'],
144
+ ->(val) { val.instance_of? String }) and
145
+ APIHelper.valid_type?(value['timestamp'],
146
+ ->(val) { val.instance_of? String }) and
147
+ APIHelper.valid_type?(value['data'],
148
+ ->(val) { Data3.validate(val) },
149
+ is_model_hash: true)
150
+ )
151
+ end
152
+
153
+ # Provides a human-readable string representation of the object.
154
+ def to_s
155
+ class_name = self.class.name.split('::').last
156
+ "<#{class_name} workflow: #{@workflow}, id: #{@id}, timestamp: #{@timestamp},"\
157
+ " customer_metadata: #{@customer_metadata}, data: #{@data}, additional_properties:"\
158
+ " #{@additional_properties}>"
159
+ end
160
+
161
+ # Provides a debugging-friendly string with detailed object information.
162
+ def inspect
163
+ class_name = self.class.name.split('::').last
164
+ "<#{class_name} workflow: #{@workflow.inspect}, id: #{@id.inspect}, timestamp:"\
165
+ " #{@timestamp.inspect}, customer_metadata: #{@customer_metadata.inspect}, data:"\
166
+ " #{@data.inspect}, additional_properties: #{@additional_properties}>"
167
+ end
168
+ end
169
+ end