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,106 @@
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
+ # Represents a snapshot of the account’s state at a specific point in time.
9
+ class AccountSnapshot < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # The timestamp indicating when the evaluation was initiated, in ISO 8601 /
14
+ # RFC 3339 format.
15
+ # @return [DateTime]
16
+ attr_accessor :timestamp
17
+
18
+ # A read-only snapshot of the account’s balances and recent activity.
19
+ # @return [AccountView]
20
+ attr_accessor :account_view
21
+
22
+ # A mapping from model property names to API property names.
23
+ def self.names
24
+ @_hash = {} if @_hash.nil?
25
+ @_hash['timestamp'] = 'timestamp'
26
+ @_hash['account_view'] = 'account_view'
27
+ @_hash
28
+ end
29
+
30
+ # An array for optional fields
31
+ def self.optionals
32
+ %w[
33
+ timestamp
34
+ account_view
35
+ ]
36
+ end
37
+
38
+ # An array for nullable fields
39
+ def self.nullables
40
+ []
41
+ end
42
+
43
+ def initialize(timestamp: SKIP, account_view: SKIP,
44
+ additional_properties: nil)
45
+ # Add additional model properties to the instance
46
+ additional_properties = {} if additional_properties.nil?
47
+
48
+ @timestamp = timestamp unless timestamp == SKIP
49
+ @account_view = account_view unless account_view == SKIP
50
+ @additional_properties = additional_properties
51
+ end
52
+
53
+ # Creates an instance of the object from a hash.
54
+ def self.from_hash(hash)
55
+ return nil unless hash
56
+
57
+ # Extract variables from the hash.
58
+ timestamp = if hash.key?('timestamp')
59
+ (DateTimeHelper.from_rfc3339(hash['timestamp']) if hash['timestamp'])
60
+ else
61
+ SKIP
62
+ end
63
+ account_view = AccountView.from_hash(hash['account_view']) if hash['account_view']
64
+
65
+ # Create a new hash for additional properties, removing known properties.
66
+ new_hash = hash.reject { |k, _| names.value?(k) }
67
+
68
+ additional_properties = APIHelper.get_additional_properties(
69
+ new_hash, proc { |value| value }
70
+ )
71
+
72
+ # Create object from extracted values.
73
+ AccountSnapshot.new(timestamp: timestamp,
74
+ account_view: account_view,
75
+ additional_properties: additional_properties)
76
+ end
77
+
78
+ def to_custom_timestamp
79
+ DateTimeHelper.to_rfc3339(timestamp)
80
+ end
81
+
82
+ # Validates an instance of the object from a given value.
83
+ # @param [AccountSnapshot | Hash] The value against the validation is performed.
84
+ def self.validate(value)
85
+ return true if value.instance_of? self
86
+
87
+ return false unless value.instance_of? Hash
88
+
89
+ true
90
+ end
91
+
92
+ # Provides a human-readable string representation of the object.
93
+ def to_s
94
+ class_name = self.class.name.split('::').last
95
+ "<#{class_name} timestamp: #{@timestamp}, account_view: #{@account_view},"\
96
+ " additional_properties: #{@additional_properties}>"
97
+ end
98
+
99
+ # Provides a debugging-friendly string with detailed object information.
100
+ def inspect
101
+ class_name = self.class.name.split('::').last
102
+ "<#{class_name} timestamp: #{@timestamp.inspect}, account_view: #{@account_view.inspect},"\
103
+ " additional_properties: #{@additional_properties}>"
104
+ end
105
+ end
106
+ end
@@ -0,0 +1,116 @@
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
+ # A read-only snapshot of the account’s balances and recent activity.
9
+ class AccountView < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Represents a monetary amount with its associated currency.
14
+ # @return [Amount]
15
+ attr_accessor :available_balance
16
+
17
+ # Represents a monetary amount with its associated currency.
18
+ # @return [Amount]
19
+ attr_accessor :current_balance
20
+
21
+ # Represents a monetary amount with its associated currency.
22
+ # @return [DateTime]
23
+ attr_accessor :last_activity_at
24
+
25
+ # A mapping from model property names to API property names.
26
+ def self.names
27
+ @_hash = {} if @_hash.nil?
28
+ @_hash['available_balance'] = 'available_balance'
29
+ @_hash['current_balance'] = 'current_balance'
30
+ @_hash['last_activity_at'] = 'last_activity_at'
31
+ @_hash
32
+ end
33
+
34
+ # An array for optional fields
35
+ def self.optionals
36
+ %w[
37
+ available_balance
38
+ current_balance
39
+ last_activity_at
40
+ ]
41
+ end
42
+
43
+ # An array for nullable fields
44
+ def self.nullables
45
+ []
46
+ end
47
+
48
+ def initialize(available_balance: SKIP, current_balance: SKIP,
49
+ last_activity_at: SKIP, additional_properties: nil)
50
+ # Add additional model properties to the instance
51
+ additional_properties = {} if additional_properties.nil?
52
+
53
+ @available_balance = available_balance unless available_balance == SKIP
54
+ @current_balance = current_balance unless current_balance == SKIP
55
+ @last_activity_at = last_activity_at unless last_activity_at == SKIP
56
+ @additional_properties = additional_properties
57
+ end
58
+
59
+ # Creates an instance of the object from a hash.
60
+ def self.from_hash(hash)
61
+ return nil unless hash
62
+
63
+ # Extract variables from the hash.
64
+ available_balance = Amount.from_hash(hash['available_balance']) if hash['available_balance']
65
+ current_balance = Amount.from_hash(hash['current_balance']) if hash['current_balance']
66
+ last_activity_at = if hash.key?('last_activity_at')
67
+ (DateTimeHelper.from_rfc3339(hash['last_activity_at']) if hash['last_activity_at'])
68
+ else
69
+ SKIP
70
+ end
71
+
72
+ # Create a new hash for additional properties, removing known properties.
73
+ new_hash = hash.reject { |k, _| names.value?(k) }
74
+
75
+ additional_properties = APIHelper.get_additional_properties(
76
+ new_hash, proc { |value| value }
77
+ )
78
+
79
+ # Create object from extracted values.
80
+ AccountView.new(available_balance: available_balance,
81
+ current_balance: current_balance,
82
+ last_activity_at: last_activity_at,
83
+ additional_properties: additional_properties)
84
+ end
85
+
86
+ def to_custom_last_activity_at
87
+ DateTimeHelper.to_rfc3339(last_activity_at)
88
+ end
89
+
90
+ # Validates an instance of the object from a given value.
91
+ # @param [AccountView | Hash] The value against the validation is performed.
92
+ def self.validate(value)
93
+ return true if value.instance_of? self
94
+
95
+ return false unless value.instance_of? Hash
96
+
97
+ true
98
+ end
99
+
100
+ # Provides a human-readable string representation of the object.
101
+ def to_s
102
+ class_name = self.class.name.split('::').last
103
+ "<#{class_name} available_balance: #{@available_balance}, current_balance:"\
104
+ " #{@current_balance}, last_activity_at: #{@last_activity_at}, additional_properties:"\
105
+ " #{@additional_properties}>"
106
+ end
107
+
108
+ # Provides a debugging-friendly string with detailed object information.
109
+ def inspect
110
+ class_name = self.class.name.split('::').last
111
+ "<#{class_name} available_balance: #{@available_balance.inspect}, current_balance:"\
112
+ " #{@current_balance.inspect}, last_activity_at: #{@last_activity_at.inspect},"\
113
+ " additional_properties: #{@additional_properties}>"
114
+ end
115
+ end
116
+ end
@@ -0,0 +1,88 @@
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
+ # A top-level container for instructions that modify the lifecycle of the
8
+ # current evaluation session.
9
+ class Actions < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Set to `true` to force the workflow out of an `ON_HOLD` state. This
14
+ # bypasses the current paused step (for example, OTP entry) so the consumer
15
+ # can fix a typo or switch delivery channels.
16
+ # @return [TrueClass | FalseClass]
17
+ attr_accessor :resume
18
+
19
+ # A mapping from model property names to API property names.
20
+ def self.names
21
+ @_hash = {} if @_hash.nil?
22
+ @_hash['resume'] = 'resume'
23
+ @_hash
24
+ end
25
+
26
+ # An array for optional fields
27
+ def self.optionals
28
+ %w[
29
+ resume
30
+ ]
31
+ end
32
+
33
+ # An array for nullable fields
34
+ def self.nullables
35
+ []
36
+ end
37
+
38
+ def initialize(resume: SKIP, additional_properties: nil)
39
+ # Add additional model properties to the instance
40
+ additional_properties = {} if additional_properties.nil?
41
+
42
+ @resume = resume unless resume == SKIP
43
+ @additional_properties = additional_properties
44
+ end
45
+
46
+ # Creates an instance of the object from a hash.
47
+ def self.from_hash(hash)
48
+ return nil unless hash
49
+
50
+ # Extract variables from the hash.
51
+ resume = hash.key?('resume') ? hash['resume'] : SKIP
52
+
53
+ # Create a new hash for additional properties, removing known properties.
54
+ new_hash = hash.reject { |k, _| names.value?(k) }
55
+
56
+ additional_properties = APIHelper.get_additional_properties(
57
+ new_hash, proc { |value| value }
58
+ )
59
+
60
+ # Create object from extracted values.
61
+ Actions.new(resume: resume,
62
+ additional_properties: additional_properties)
63
+ end
64
+
65
+ # Validates an instance of the object from a given value.
66
+ # @param [Actions | Hash] The value against the validation is performed.
67
+ def self.validate(value)
68
+ return true if value.instance_of? self
69
+
70
+ return false unless value.instance_of? Hash
71
+
72
+ true
73
+ end
74
+
75
+ # Provides a human-readable string representation of the object.
76
+ def to_s
77
+ class_name = self.class.name.split('::').last
78
+ "<#{class_name} resume: #{@resume}, additional_properties: #{@additional_properties}>"
79
+ end
80
+
81
+ # Provides a debugging-friendly string with detailed object information.
82
+ def inspect
83
+ class_name = self.class.name.split('::').last
84
+ "<#{class_name} resume: #{@resume.inspect}, additional_properties:"\
85
+ " #{@additional_properties}>"
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,235 @@
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
+ # Use this field to pass additional data required by specific Socure products.
9
+ # Additional fields are typically optional and should only be used if
10
+ # explicitly stated in the product documentation.
11
+ class AdditionalContext < BaseModel
12
+ SKIP = Object.new
13
+ private_constant :SKIP
14
+
15
+ # Indicates if the consumer has provided consent. This field must be set to
16
+ # `true` in order for the transaction to be processed; otherwise a 400 error
17
+ # will be returned.
18
+ # > **Note**: A `null` value can be passed in the field to skip the eCBSV
19
+ # module and still process the transaction with the other modules included
20
+ # in the request.
21
+ # @return [TrueClass | FalseClass]
22
+ attr_accessor :user_consent
23
+
24
+ # The date and time when the user provided consent, specified in ISO 8601
25
+ # format. If no value is provided, defaults to the current timestamp of the
26
+ # evaluation.
27
+ # > **Note**: Although the `consentTimestamp` parameter is optional, it's
28
+ # crucial to provide it when using the `ecbsv` module to meet the 90-day
29
+ # consent window set by the SSA for compliance with the eCBSV service.
30
+ # @return [DateTime]
31
+ attr_accessor :consent_timestamp
32
+
33
+ # The `referenceId` of a previous Socure transaction. Allows you to link
34
+ # multiple transactions together.
35
+ # @return [String]
36
+ attr_accessor :previous_reference_id
37
+
38
+ # The username associated with a consumer's account.
39
+ # @return [String]
40
+ attr_accessor :user_name
41
+
42
+ # This field must be set to `GLBA_502(e)` to support acceptable use of the
43
+ # product. Data contributed to Sigma First-Party Fraud is Non-Public
44
+ # Information (NPI) that may only be further disclosed pursuant to the GLBA
45
+ # fraud exception.
46
+ # @return [DisclosurePurpose]
47
+ attr_accessor :disclosure_purpose
48
+
49
+ # The entity type. Possible values are `Individual`, `Organization`,
50
+ # `Vessel`, `Aircraft`, `Others`.
51
+ # @return [String]
52
+ attr_accessor :entity_type
53
+
54
+ # The entity's full name. Must not contain special characters.
55
+ # @return [String]
56
+ attr_accessor :entity_name
57
+
58
+ # Set to `true` if the entity was accepted to conduct business with your
59
+ # organization. The default setting is `false`.
60
+ # @return [TrueClass | FalseClass]
61
+ attr_accessor :accept_list
62
+
63
+ # Optional notes that capture details about known risks when conducting
64
+ # business with the entity. Only use this field if the `accept_list` is set
65
+ # to `true`.
66
+ # @return [String]
67
+ attr_accessor :notes
68
+
69
+ # The driver's license identification number.
70
+ # @return [String]
71
+ attr_accessor :driver_license
72
+
73
+ # The two letter postal code of the issuing state.
74
+ # @return [String]
75
+ attr_accessor :driver_license_state
76
+
77
+ # Set to `true` to run Socure Phone Risk with Real-Time SIM Swap
78
+ # Verification. When enabled, the Phone Risk response returns additional SIM
79
+ # Swap reason codes. Requires the Phone Risk with SIM Swap enrichment to be
80
+ # configured in your workflow.
81
+ # @return [TrueClass | FalseClass]
82
+ attr_accessor :mno_status
83
+
84
+ # A mapping from model property names to API property names.
85
+ def self.names
86
+ @_hash = {} if @_hash.nil?
87
+ @_hash['user_consent'] = 'user_consent'
88
+ @_hash['consent_timestamp'] = 'consent_timestamp'
89
+ @_hash['previous_reference_id'] = 'previous_reference_id'
90
+ @_hash['user_name'] = 'user_name'
91
+ @_hash['disclosure_purpose'] = 'disclosure_purpose'
92
+ @_hash['entity_type'] = 'entity_type'
93
+ @_hash['entity_name'] = 'entity_name'
94
+ @_hash['accept_list'] = 'accept_list'
95
+ @_hash['notes'] = 'notes'
96
+ @_hash['driver_license'] = 'driver_license'
97
+ @_hash['driver_license_state'] = 'driver_license_state'
98
+ @_hash['mno_status'] = 'mno_status'
99
+ @_hash
100
+ end
101
+
102
+ # An array for optional fields
103
+ def self.optionals
104
+ %w[
105
+ user_consent
106
+ consent_timestamp
107
+ previous_reference_id
108
+ user_name
109
+ disclosure_purpose
110
+ entity_type
111
+ entity_name
112
+ accept_list
113
+ notes
114
+ driver_license
115
+ driver_license_state
116
+ mno_status
117
+ ]
118
+ end
119
+
120
+ # An array for nullable fields
121
+ def self.nullables
122
+ []
123
+ end
124
+
125
+ def initialize(user_consent: SKIP, consent_timestamp: SKIP,
126
+ previous_reference_id: SKIP, user_name: SKIP,
127
+ disclosure_purpose: SKIP, entity_type: SKIP,
128
+ entity_name: SKIP, accept_list: SKIP, notes: SKIP,
129
+ driver_license: SKIP, driver_license_state: SKIP,
130
+ mno_status: SKIP, additional_properties: nil)
131
+ # Add additional model properties to the instance
132
+ additional_properties = {} if additional_properties.nil?
133
+
134
+ @user_consent = user_consent unless user_consent == SKIP
135
+ @consent_timestamp = consent_timestamp unless consent_timestamp == SKIP
136
+ @previous_reference_id = previous_reference_id unless previous_reference_id == SKIP
137
+ @user_name = user_name unless user_name == SKIP
138
+ @disclosure_purpose = disclosure_purpose unless disclosure_purpose == SKIP
139
+ @entity_type = entity_type unless entity_type == SKIP
140
+ @entity_name = entity_name unless entity_name == SKIP
141
+ @accept_list = accept_list unless accept_list == SKIP
142
+ @notes = notes unless notes == SKIP
143
+ @driver_license = driver_license unless driver_license == SKIP
144
+ @driver_license_state = driver_license_state unless driver_license_state == SKIP
145
+ @mno_status = mno_status unless mno_status == SKIP
146
+ @additional_properties = additional_properties
147
+ end
148
+
149
+ # Creates an instance of the object from a hash.
150
+ def self.from_hash(hash)
151
+ return nil unless hash
152
+
153
+ # Extract variables from the hash.
154
+ user_consent = hash.key?('user_consent') ? hash['user_consent'] : SKIP
155
+ consent_timestamp = if hash.key?('consent_timestamp')
156
+ (DateTimeHelper.from_rfc3339(hash['consent_timestamp']) if hash['consent_timestamp'])
157
+ else
158
+ SKIP
159
+ end
160
+ previous_reference_id =
161
+ hash.key?('previous_reference_id') ? hash['previous_reference_id'] : SKIP
162
+ user_name = hash.key?('user_name') ? hash['user_name'] : SKIP
163
+ disclosure_purpose =
164
+ hash.key?('disclosure_purpose') ? hash['disclosure_purpose'] : SKIP
165
+ entity_type = hash.key?('entity_type') ? hash['entity_type'] : SKIP
166
+ entity_name = hash.key?('entity_name') ? hash['entity_name'] : SKIP
167
+ accept_list = hash.key?('accept_list') ? hash['accept_list'] : SKIP
168
+ notes = hash.key?('notes') ? hash['notes'] : SKIP
169
+ driver_license =
170
+ hash.key?('driver_license') ? hash['driver_license'] : SKIP
171
+ driver_license_state =
172
+ hash.key?('driver_license_state') ? hash['driver_license_state'] : SKIP
173
+ mno_status = hash.key?('mno_status') ? hash['mno_status'] : SKIP
174
+
175
+ # Create a new hash for additional properties, removing known properties.
176
+ new_hash = hash.reject { |k, _| names.value?(k) }
177
+
178
+ additional_properties = APIHelper.get_additional_properties(
179
+ new_hash, proc { |value| value }
180
+ )
181
+
182
+ # Create object from extracted values.
183
+ AdditionalContext.new(user_consent: user_consent,
184
+ consent_timestamp: consent_timestamp,
185
+ previous_reference_id: previous_reference_id,
186
+ user_name: user_name,
187
+ disclosure_purpose: disclosure_purpose,
188
+ entity_type: entity_type,
189
+ entity_name: entity_name,
190
+ accept_list: accept_list,
191
+ notes: notes,
192
+ driver_license: driver_license,
193
+ driver_license_state: driver_license_state,
194
+ mno_status: mno_status,
195
+ additional_properties: additional_properties)
196
+ end
197
+
198
+ def to_custom_consent_timestamp
199
+ DateTimeHelper.to_rfc3339(consent_timestamp)
200
+ end
201
+
202
+ # Validates an instance of the object from a given value.
203
+ # @param [AdditionalContext | Hash] The value against the validation is performed.
204
+ def self.validate(value)
205
+ return true if value.instance_of? self
206
+
207
+ return false unless value.instance_of? Hash
208
+
209
+ true
210
+ end
211
+
212
+ # Provides a human-readable string representation of the object.
213
+ def to_s
214
+ class_name = self.class.name.split('::').last
215
+ "<#{class_name} user_consent: #{@user_consent}, consent_timestamp: #{@consent_timestamp},"\
216
+ " previous_reference_id: #{@previous_reference_id}, user_name: #{@user_name},"\
217
+ " disclosure_purpose: #{@disclosure_purpose}, entity_type: #{@entity_type}, entity_name:"\
218
+ " #{@entity_name}, accept_list: #{@accept_list}, notes: #{@notes}, driver_license:"\
219
+ " #{@driver_license}, driver_license_state: #{@driver_license_state}, mno_status:"\
220
+ " #{@mno_status}, additional_properties: #{@additional_properties}>"
221
+ end
222
+
223
+ # Provides a debugging-friendly string with detailed object information.
224
+ def inspect
225
+ class_name = self.class.name.split('::').last
226
+ "<#{class_name} user_consent: #{@user_consent.inspect}, consent_timestamp:"\
227
+ " #{@consent_timestamp.inspect}, previous_reference_id: #{@previous_reference_id.inspect},"\
228
+ " user_name: #{@user_name.inspect}, disclosure_purpose: #{@disclosure_purpose.inspect},"\
229
+ " entity_type: #{@entity_type.inspect}, entity_name: #{@entity_name.inspect}, accept_list:"\
230
+ " #{@accept_list.inspect}, notes: #{@notes.inspect}, driver_license:"\
231
+ " #{@driver_license.inspect}, driver_license_state: #{@driver_license_state.inspect},"\
232
+ " mno_status: #{@mno_status.inspect}, additional_properties: #{@additional_properties}>"
233
+ end
234
+ end
235
+ end