tesser-api-sdk 1.0.0

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 (101) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +148 -0
  4. data/bin/console +15 -0
  5. data/lib/tesser_apiv1/api_helper.rb +10 -0
  6. data/lib/tesser_apiv1/client.rb +118 -0
  7. data/lib/tesser_apiv1/configuration.rb +182 -0
  8. data/lib/tesser_apiv1/controllers/accounts_controller.rb +193 -0
  9. data/lib/tesser_apiv1/controllers/base_controller.rb +60 -0
  10. data/lib/tesser_apiv1/controllers/counterparties_controller.rb +171 -0
  11. data/lib/tesser_apiv1/controllers/currencies_controller.rb +39 -0
  12. data/lib/tesser_apiv1/controllers/experimental_controller.rb +49 -0
  13. data/lib/tesser_apiv1/controllers/health_controller.rb +24 -0
  14. data/lib/tesser_apiv1/controllers/networks_controller.rb +39 -0
  15. data/lib/tesser_apiv1/controllers/payments_controller.rb +202 -0
  16. data/lib/tesser_apiv1/controllers/tenants_controller.rb +156 -0
  17. data/lib/tesser_apiv1/controllers/treasury_controller.rb +77 -0
  18. data/lib/tesser_apiv1/exceptions/api_exception.rb +21 -0
  19. data/lib/tesser_apiv1/http/auth/o_auth2.rb +53 -0
  20. data/lib/tesser_apiv1/http/http_call_back.rb +10 -0
  21. data/lib/tesser_apiv1/http/http_method_enum.rb +10 -0
  22. data/lib/tesser_apiv1/http/http_request.rb +10 -0
  23. data/lib/tesser_apiv1/http/http_response.rb +10 -0
  24. data/lib/tesser_apiv1/http/proxy_settings.rb +22 -0
  25. data/lib/tesser_apiv1/models/account.rb +230 -0
  26. data/lib/tesser_apiv1/models/account_list_item.rb +230 -0
  27. data/lib/tesser_apiv1/models/account_list_response.rb +69 -0
  28. data/lib/tesser_apiv1/models/account_response.rb +60 -0
  29. data/lib/tesser_apiv1/models/account_safe.rb +218 -0
  30. data/lib/tesser_apiv1/models/balance_status1_enum.rb +40 -0
  31. data/lib/tesser_apiv1/models/balance_status_enum.rb +40 -0
  32. data/lib/tesser_apiv1/models/base_model.rb +110 -0
  33. data/lib/tesser_apiv1/models/classification7_enum.rb +36 -0
  34. data/lib/tesser_apiv1/models/classification_enum.rb +36 -0
  35. data/lib/tesser_apiv1/models/counterparty.rb +411 -0
  36. data/lib/tesser_apiv1/models/counterparty_list_response.rb +69 -0
  37. data/lib/tesser_apiv1/models/counterparty_response.rb +60 -0
  38. data/lib/tesser_apiv1/models/create_bank_request.rb +122 -0
  39. data/lib/tesser_apiv1/models/create_bank_response.rb +60 -0
  40. data/lib/tesser_apiv1/models/create_counterparty_request.rb +350 -0
  41. data/lib/tesser_apiv1/models/create_counterparty_response.rb +60 -0
  42. data/lib/tesser_apiv1/models/create_deposit_request.rb +119 -0
  43. data/lib/tesser_apiv1/models/create_payment_request.rb +168 -0
  44. data/lib/tesser_apiv1/models/create_tenant_request.rb +183 -0
  45. data/lib/tesser_apiv1/models/create_tenant_response.rb +60 -0
  46. data/lib/tesser_apiv1/models/create_wallet_request.rb +112 -0
  47. data/lib/tesser_apiv1/models/create_wallet_response.rb +60 -0
  48. data/lib/tesser_apiv1/models/create_withdrawal_request.rb +130 -0
  49. data/lib/tesser_apiv1/models/currencies_response.rb +69 -0
  50. data/lib/tesser_apiv1/models/currency.rb +119 -0
  51. data/lib/tesser_apiv1/models/data.rb +221 -0
  52. data/lib/tesser_apiv1/models/data6.rb +242 -0
  53. data/lib/tesser_apiv1/models/data7.rb +419 -0
  54. data/lib/tesser_apiv1/models/data8.rb +200 -0
  55. data/lib/tesser_apiv1/models/direction1_enum.rb +40 -0
  56. data/lib/tesser_apiv1/models/direction_enum.rb +40 -0
  57. data/lib/tesser_apiv1/models/execute_payment_request_dto.rb +71 -0
  58. data/lib/tesser_apiv1/models/fee.rb +117 -0
  59. data/lib/tesser_apiv1/models/fee1.rb +117 -0
  60. data/lib/tesser_apiv1/models/network.rb +68 -0
  61. data/lib/tesser_apiv1/models/networks_response.rb +69 -0
  62. data/lib/tesser_apiv1/models/pagination.rb +104 -0
  63. data/lib/tesser_apiv1/models/payment.rb +421 -0
  64. data/lib/tesser_apiv1/models/payment_list_response.rb +79 -0
  65. data/lib/tesser_apiv1/models/payment_response.rb +60 -0
  66. data/lib/tesser_apiv1/models/payment_type3_enum.rb +52 -0
  67. data/lib/tesser_apiv1/models/payment_type_enum.rb +54 -0
  68. data/lib/tesser_apiv1/models/provider_key1_enum.rb +36 -0
  69. data/lib/tesser_apiv1/models/provider_key_enum.rb +36 -0
  70. data/lib/tesser_apiv1/models/response.rb +81 -0
  71. data/lib/tesser_apiv1/models/review_payment_request.rb +60 -0
  72. data/lib/tesser_apiv1/models/risk_status_enum.rb +44 -0
  73. data/lib/tesser_apiv1/models/status1_enum.rb +52 -0
  74. data/lib/tesser_apiv1/models/status_enum.rb +48 -0
  75. data/lib/tesser_apiv1/models/step.rb +421 -0
  76. data/lib/tesser_apiv1/models/step_type_enum.rb +44 -0
  77. data/lib/tesser_apiv1/models/tenant.rb +275 -0
  78. data/lib/tesser_apiv1/models/tenant_api_credentials.rb +88 -0
  79. data/lib/tesser_apiv1/models/tenant_list_response.rb +69 -0
  80. data/lib/tesser_apiv1/models/tenant_response.rb +60 -0
  81. data/lib/tesser_apiv1/models/transfer_step.rb +422 -0
  82. data/lib/tesser_apiv1/models/turnkey_stamp.rb +81 -0
  83. data/lib/tesser_apiv1/models/type3_enum.rb +40 -0
  84. data/lib/tesser_apiv1/models/type4_enum.rb +44 -0
  85. data/lib/tesser_apiv1/models/type_enum.rb +44 -0
  86. data/lib/tesser_apiv1/models/update_account_request.rb +62 -0
  87. data/lib/tesser_apiv1/models/update_account_response.rb +60 -0
  88. data/lib/tesser_apiv1/models/update_counterparty_request.rb +166 -0
  89. data/lib/tesser_apiv1/models/update_counterparty_response.rb +60 -0
  90. data/lib/tesser_apiv1/models/update_payment_request.rb +100 -0
  91. data/lib/tesser_apiv1/models/update_tenant_request.rb +111 -0
  92. data/lib/tesser_apiv1/models/update_tenant_response.rb +60 -0
  93. data/lib/tesser_apiv1/utilities/date_time_helper.rb +11 -0
  94. data/lib/tesser_apiv1/utilities/file_wrapper.rb +28 -0
  95. data/lib/tesser_apiv1/utilities/union_type_lookup.rb +1234 -0
  96. data/lib/tesser_apiv1.rb +116 -0
  97. data/test/controllers/controller_test_base.rb +23 -0
  98. data/test/controllers/test_health_controller.rb +31 -0
  99. data/test/controllers/test_tenants_controller.rb +133 -0
  100. data/test/http_response_catcher.rb +19 -0
  101. metadata +212 -0
@@ -0,0 +1,130 @@
1
+ # tesser_apiv1
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module TesserApiv1
7
+ # CreateWithdrawalRequest Model.
8
+ class CreateWithdrawalRequest < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Destination account ID.
13
+ # @return [String]
14
+ attr_accessor :to_account_id
15
+
16
+ # Source currency code.
17
+ # @return [String]
18
+ attr_accessor :from_currency
19
+
20
+ # Destination currency code.
21
+ # @return [String]
22
+ attr_accessor :to_currency
23
+
24
+ # Amount to send. Required if to_amount is missing.
25
+ # @return [String]
26
+ attr_accessor :from_amount
27
+
28
+ # Amount to receive. Required if from_amount is missing.
29
+ # @return [String]
30
+ attr_accessor :to_amount
31
+
32
+ # Optional tenant ID.
33
+ # @return [String]
34
+ attr_accessor :tenant_id
35
+
36
+ # Source account ID.
37
+ # @return [String]
38
+ attr_accessor :from_account_id
39
+
40
+ # Network for the withdrawal.
41
+ # @return [String]
42
+ attr_accessor :from_network
43
+
44
+ # A mapping from model property names to API property names.
45
+ def self.names
46
+ @_hash = {} if @_hash.nil?
47
+ @_hash['to_account_id'] = 'to_account_id'
48
+ @_hash['from_currency'] = 'from_currency'
49
+ @_hash['to_currency'] = 'to_currency'
50
+ @_hash['from_amount'] = 'from_amount'
51
+ @_hash['to_amount'] = 'to_amount'
52
+ @_hash['tenant_id'] = 'tenant_id'
53
+ @_hash['from_account_id'] = 'from_account_id'
54
+ @_hash['from_network'] = 'from_network'
55
+ @_hash
56
+ end
57
+
58
+ # An array for optional fields
59
+ def self.optionals
60
+ %w[
61
+ from_amount
62
+ to_amount
63
+ tenant_id
64
+ ]
65
+ end
66
+
67
+ # An array for nullable fields
68
+ def self.nullables
69
+ []
70
+ end
71
+
72
+ def initialize(to_account_id = nil, from_currency = nil, to_currency = nil,
73
+ from_account_id = nil, from_network = nil,
74
+ from_amount = SKIP, to_amount = SKIP, tenant_id = SKIP)
75
+ @to_account_id = to_account_id
76
+ @from_currency = from_currency
77
+ @to_currency = to_currency
78
+ @from_amount = from_amount unless from_amount == SKIP
79
+ @to_amount = to_amount unless to_amount == SKIP
80
+ @tenant_id = tenant_id unless tenant_id == SKIP
81
+ @from_account_id = from_account_id
82
+ @from_network = from_network
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
+ to_account_id = hash.key?('to_account_id') ? hash['to_account_id'] : nil
91
+ from_currency = hash.key?('from_currency') ? hash['from_currency'] : nil
92
+ to_currency = hash.key?('to_currency') ? hash['to_currency'] : nil
93
+ from_account_id =
94
+ hash.key?('from_account_id') ? hash['from_account_id'] : nil
95
+ from_network = hash.key?('from_network') ? hash['from_network'] : nil
96
+ from_amount = hash.key?('from_amount') ? hash['from_amount'] : SKIP
97
+ to_amount = hash.key?('to_amount') ? hash['to_amount'] : SKIP
98
+ tenant_id = hash.key?('tenant_id') ? hash['tenant_id'] : SKIP
99
+
100
+ # Create object from extracted values.
101
+ CreateWithdrawalRequest.new(to_account_id,
102
+ from_currency,
103
+ to_currency,
104
+ from_account_id,
105
+ from_network,
106
+ from_amount,
107
+ to_amount,
108
+ tenant_id)
109
+ end
110
+
111
+ # Provides a human-readable string representation of the object.
112
+ def to_s
113
+ class_name = self.class.name.split('::').last
114
+ "<#{class_name} to_account_id: #{@to_account_id}, from_currency: #{@from_currency},"\
115
+ " to_currency: #{@to_currency}, from_amount: #{@from_amount}, to_amount: #{@to_amount},"\
116
+ " tenant_id: #{@tenant_id}, from_account_id: #{@from_account_id}, from_network:"\
117
+ " #{@from_network}>"
118
+ end
119
+
120
+ # Provides a debugging-friendly string with detailed object information.
121
+ def inspect
122
+ class_name = self.class.name.split('::').last
123
+ "<#{class_name} to_account_id: #{@to_account_id.inspect}, from_currency:"\
124
+ " #{@from_currency.inspect}, to_currency: #{@to_currency.inspect}, from_amount:"\
125
+ " #{@from_amount.inspect}, to_amount: #{@to_amount.inspect}, tenant_id:"\
126
+ " #{@tenant_id.inspect}, from_account_id: #{@from_account_id.inspect}, from_network:"\
127
+ " #{@from_network.inspect}>"
128
+ end
129
+ end
130
+ end
@@ -0,0 +1,69 @@
1
+ # tesser_apiv1
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module TesserApiv1
7
+ # CurrenciesResponse Model.
8
+ class CurrenciesResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # List of all supported currencies
13
+ # @return [Array[Currency]]
14
+ attr_accessor :data
15
+
16
+ # A mapping from model property names to API property names.
17
+ def self.names
18
+ @_hash = {} if @_hash.nil?
19
+ @_hash['data'] = 'data'
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(data = nil)
34
+ @data = data
35
+ end
36
+
37
+ # Creates an instance of the object from a hash.
38
+ def self.from_hash(hash)
39
+ return nil unless hash
40
+
41
+ # Extract variables from the hash.
42
+ # Parameter is an array, so we need to iterate through it
43
+ data = nil
44
+ unless hash['data'].nil?
45
+ data = []
46
+ hash['data'].each do |structure|
47
+ data << (Currency.from_hash(structure) if structure)
48
+ end
49
+ end
50
+
51
+ data = nil unless hash.key?('data')
52
+
53
+ # Create object from extracted values.
54
+ CurrenciesResponse.new(data)
55
+ end
56
+
57
+ # Provides a human-readable string representation of the object.
58
+ def to_s
59
+ class_name = self.class.name.split('::').last
60
+ "<#{class_name} data: #{@data}>"
61
+ end
62
+
63
+ # Provides a debugging-friendly string with detailed object information.
64
+ def inspect
65
+ class_name = self.class.name.split('::').last
66
+ "<#{class_name} data: #{@data.inspect}>"
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,119 @@
1
+ # tesser_apiv1
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module TesserApiv1
7
+ # Currency Model.
8
+ class Currency < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Display name for the currency (e.g., 'Circle USD')
13
+ # @return [String]
14
+ attr_accessor :name
15
+
16
+ # Currency code/key (e.g., 'USDC', 'USD')
17
+ # @return [String]
18
+ attr_accessor :key
19
+
20
+ # Number of decimal places for the currency
21
+ # @return [Float]
22
+ attr_accessor :decimals
23
+
24
+ # Blockchain network (e.g., 'POLYGON') or null for fiat currencies. See GET
25
+ # /networks for supported values.
26
+ # @return [Object]
27
+ attr_accessor :network
28
+
29
+ # A mapping from model property names to API property names.
30
+ def self.names
31
+ @_hash = {} if @_hash.nil?
32
+ @_hash['name'] = 'name'
33
+ @_hash['key'] = 'key'
34
+ @_hash['decimals'] = 'decimals'
35
+ @_hash['network'] = 'network'
36
+ @_hash
37
+ end
38
+
39
+ # An array for optional fields
40
+ def self.optionals
41
+ []
42
+ end
43
+
44
+ # An array for nullable fields
45
+ def self.nullables
46
+ []
47
+ end
48
+
49
+ def initialize(name = nil, key = nil, decimals = nil, network = nil)
50
+ @name = name
51
+ @key = key
52
+ @decimals = decimals
53
+ @network = network
54
+ end
55
+
56
+ # Creates an instance of the object from a hash.
57
+ def self.from_hash(hash)
58
+ return nil unless hash
59
+
60
+ # Extract variables from the hash.
61
+ name = hash.key?('name') ? hash['name'] : nil
62
+ key = hash.key?('key') ? hash['key'] : nil
63
+ decimals = hash.key?('decimals') ? hash['decimals'] : nil
64
+ network = hash.key?('network') ? APIHelper.deserialize_union_type(
65
+ UnionTypeLookUp.get(:CurrencyNetwork), hash['network']
66
+ ) : nil
67
+
68
+ # Create object from extracted values.
69
+ Currency.new(name,
70
+ key,
71
+ decimals,
72
+ network)
73
+ end
74
+
75
+ # Validates an instance of the object from a given value.
76
+ # @param [Currency | Hash] The value against the validation is performed.
77
+ def self.validate(value)
78
+ if value.instance_of? self
79
+ return (
80
+ APIHelper.valid_type?(value.name,
81
+ ->(val) { val.instance_of? String }) and
82
+ APIHelper.valid_type?(value.key,
83
+ ->(val) { val.instance_of? String }) and
84
+ APIHelper.valid_type?(value.decimals,
85
+ ->(val) { val.instance_of? Float }) and
86
+ UnionTypeLookUp.get(:CurrencyNetwork)
87
+ .validate(value.network)
88
+ )
89
+ end
90
+
91
+ return false unless value.instance_of? Hash
92
+
93
+ (
94
+ APIHelper.valid_type?(value['name'],
95
+ ->(val) { val.instance_of? String }) and
96
+ APIHelper.valid_type?(value['key'],
97
+ ->(val) { val.instance_of? String }) and
98
+ APIHelper.valid_type?(value['decimals'],
99
+ ->(val) { val.instance_of? Float }) and
100
+ UnionTypeLookUp.get(:CurrencyNetwork)
101
+ .validate(value['network'])
102
+ )
103
+ end
104
+
105
+ # Provides a human-readable string representation of the object.
106
+ def to_s
107
+ class_name = self.class.name.split('::').last
108
+ "<#{class_name} name: #{@name}, key: #{@key}, decimals: #{@decimals}, network:"\
109
+ " #{@network}>"
110
+ end
111
+
112
+ # Provides a debugging-friendly string with detailed object information.
113
+ def inspect
114
+ class_name = self.class.name.split('::').last
115
+ "<#{class_name} name: #{@name.inspect}, key: #{@key.inspect}, decimals:"\
116
+ " #{@decimals.inspect}, network: #{@network.inspect}>"
117
+ end
118
+ end
119
+ end
@@ -0,0 +1,221 @@
1
+ # tesser_apiv1
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ require_relative 'counterparty'
7
+
8
+ module TesserApiv1
9
+ # Data Model.
10
+ class Data < Counterparty
11
+
12
+
13
+ # A mapping from model property names to API property names.
14
+ def self.names
15
+ @_hash = {} if @_hash.nil?
16
+
17
+ @_hash = super().merge(@_hash)
18
+ @_hash
19
+ end
20
+
21
+ # An array for optional fields
22
+ def self.optionals
23
+ _arr = []
24
+ (_arr << super()).flatten!
25
+ end
26
+
27
+ # An array for nullable fields
28
+ def self.nullables
29
+ _arr = []
30
+ (_arr << super()).flatten!
31
+ end
32
+
33
+ def initialize(id = nil, workspace_id = nil, classification = nil,
34
+ created_at = nil, updated_at = nil, tenant_id = SKIP,
35
+ individual_first_name = SKIP, individual_last_name = SKIP,
36
+ individual_address_country = SKIP,
37
+ individual_date_of_birth = SKIP,
38
+ individual_national_identification_number = SKIP,
39
+ individual_street_address1 = SKIP,
40
+ individual_street_address2 = SKIP, individual_city = SKIP,
41
+ individual_state = SKIP, individual_postal_code = SKIP,
42
+ business_legal_name = SKIP, business_dba = SKIP,
43
+ business_address_country = SKIP,
44
+ business_street_address1 = SKIP,
45
+ business_street_address2 = SKIP, business_city = SKIP,
46
+ business_state = SKIP,
47
+ business_legal_entity_identifier = SKIP)
48
+
49
+
50
+ # Call the constructor of the base class
51
+ super(id,
52
+ workspace_id,
53
+ classification,
54
+ created_at,
55
+ updated_at,
56
+ tenant_id,
57
+ individual_first_name,
58
+ individual_last_name,
59
+ individual_address_country,
60
+ individual_date_of_birth,
61
+ individual_national_identification_number,
62
+ individual_street_address1,
63
+ individual_street_address2,
64
+ individual_city,
65
+ individual_state,
66
+ individual_postal_code,
67
+ business_legal_name,
68
+ business_dba,
69
+ business_address_country,
70
+ business_street_address1,
71
+ business_street_address2,
72
+ business_city,
73
+ business_state,
74
+ business_legal_entity_identifier)
75
+ end
76
+
77
+ # Creates an instance of the object from a hash.
78
+ def self.from_hash(hash)
79
+ return nil unless hash
80
+
81
+ # Extract variables from the hash.
82
+ id = hash.key?('id') ? hash['id'] : nil
83
+ workspace_id = hash.key?('workspace_id') ? hash['workspace_id'] : nil
84
+ classification =
85
+ hash.key?('classification') ? hash['classification'] : nil
86
+ created_at = hash.key?('created_at') ? hash['created_at'] : nil
87
+ updated_at = hash.key?('updated_at') ? hash['updated_at'] : nil
88
+ tenant_id = hash.key?('tenant_id') ? APIHelper.deserialize_union_type(
89
+ UnionTypeLookUp.get(:CounterpartyTenantId), hash['tenant_id']
90
+ ) : SKIP
91
+ individual_first_name = hash.key?('individual_first_name') ? APIHelper.deserialize_union_type(
92
+ UnionTypeLookUp.get(:CounterpartyIndividualFirstName), hash['individual_first_name']
93
+ ) : SKIP
94
+ individual_last_name = hash.key?('individual_last_name') ? APIHelper.deserialize_union_type(
95
+ UnionTypeLookUp.get(:CounterpartyIndividualLastName), hash['individual_last_name']
96
+ ) : SKIP
97
+ individual_address_country = hash.key?('individual_address_country') ? APIHelper.deserialize_union_type(
98
+ UnionTypeLookUp.get(:CounterpartyIndividualAddressCountry), hash['individual_address_country']
99
+ ) : SKIP
100
+ individual_date_of_birth = hash.key?('individual_date_of_birth') ? APIHelper.deserialize_union_type(
101
+ UnionTypeLookUp.get(:CounterpartyIndividualDateOfBirth), hash['individual_date_of_birth']
102
+ ) : SKIP
103
+ individual_national_identification_number = hash.key?('individual_national_identification_number') ? APIHelper.deserialize_union_type(
104
+ UnionTypeLookUp.get(:CounterpartyIndividualNationalIdentificationNumber), hash['individual_national_identification_number']
105
+ ) : SKIP
106
+ individual_street_address1 = hash.key?('individual_street_address1') ? APIHelper.deserialize_union_type(
107
+ UnionTypeLookUp.get(:CounterpartyIndividualStreetAddress1), hash['individual_street_address1']
108
+ ) : SKIP
109
+ individual_street_address2 = hash.key?('individual_street_address2') ? APIHelper.deserialize_union_type(
110
+ UnionTypeLookUp.get(:CounterpartyIndividualStreetAddress2), hash['individual_street_address2']
111
+ ) : SKIP
112
+ individual_city = hash.key?('individual_city') ? APIHelper.deserialize_union_type(
113
+ UnionTypeLookUp.get(:CounterpartyIndividualCity), hash['individual_city']
114
+ ) : SKIP
115
+ individual_state = hash.key?('individual_state') ? APIHelper.deserialize_union_type(
116
+ UnionTypeLookUp.get(:CounterpartyIndividualState), hash['individual_state']
117
+ ) : SKIP
118
+ individual_postal_code = hash.key?('individual_postal_code') ? APIHelper.deserialize_union_type(
119
+ UnionTypeLookUp.get(:CounterpartyIndividualPostalCode), hash['individual_postal_code']
120
+ ) : SKIP
121
+ business_legal_name = hash.key?('business_legal_name') ? APIHelper.deserialize_union_type(
122
+ UnionTypeLookUp.get(:CounterpartyBusinessLegalName), hash['business_legal_name']
123
+ ) : SKIP
124
+ business_dba = hash.key?('business_dba') ? APIHelper.deserialize_union_type(
125
+ UnionTypeLookUp.get(:CounterpartyBusinessDba), hash['business_dba']
126
+ ) : SKIP
127
+ business_address_country = hash.key?('business_address_country') ? APIHelper.deserialize_union_type(
128
+ UnionTypeLookUp.get(:CounterpartyBusinessAddressCountry), hash['business_address_country']
129
+ ) : SKIP
130
+ business_street_address1 = hash.key?('business_street_address1') ? APIHelper.deserialize_union_type(
131
+ UnionTypeLookUp.get(:CounterpartyBusinessStreetAddress1), hash['business_street_address1']
132
+ ) : SKIP
133
+ business_street_address2 = hash.key?('business_street_address2') ? APIHelper.deserialize_union_type(
134
+ UnionTypeLookUp.get(:CounterpartyBusinessStreetAddress2), hash['business_street_address2']
135
+ ) : SKIP
136
+ business_city = hash.key?('business_city') ? APIHelper.deserialize_union_type(
137
+ UnionTypeLookUp.get(:CounterpartyBusinessCity), hash['business_city']
138
+ ) : SKIP
139
+ business_state = hash.key?('business_state') ? APIHelper.deserialize_union_type(
140
+ UnionTypeLookUp.get(:CounterpartyBusinessState), hash['business_state']
141
+ ) : SKIP
142
+ business_legal_entity_identifier = hash.key?('business_legal_entity_identifier') ? APIHelper.deserialize_union_type(
143
+ UnionTypeLookUp.get(:CounterpartyBusinessLegalEntityIdentifier), hash['business_legal_entity_identifier']
144
+ ) : SKIP
145
+
146
+ # Create object from extracted values.
147
+ Data.new(id,
148
+ workspace_id,
149
+ classification,
150
+ created_at,
151
+ updated_at,
152
+ tenant_id,
153
+ individual_first_name,
154
+ individual_last_name,
155
+ individual_address_country,
156
+ individual_date_of_birth,
157
+ individual_national_identification_number,
158
+ individual_street_address1,
159
+ individual_street_address2,
160
+ individual_city,
161
+ individual_state,
162
+ individual_postal_code,
163
+ business_legal_name,
164
+ business_dba,
165
+ business_address_country,
166
+ business_street_address1,
167
+ business_street_address2,
168
+ business_city,
169
+ business_state,
170
+ business_legal_entity_identifier)
171
+ end
172
+
173
+ # Validates an instance of the object from a given value.
174
+ # @param [Data | Hash] The value against the validation is performed.
175
+ def self.validate(value)
176
+ if value.instance_of? self
177
+ return (
178
+ APIHelper.valid_type?(value.id,
179
+ ->(val) { val.instance_of? String }) and
180
+ APIHelper.valid_type?(value.workspace_id,
181
+ ->(val) { val.instance_of? String }) and
182
+ APIHelper.valid_type?(value.classification,
183
+ ->(val) { ClassificationEnum.validate(val) }) and
184
+ APIHelper.valid_type?(value.created_at,
185
+ ->(val) { val.instance_of? String }) and
186
+ APIHelper.valid_type?(value.updated_at,
187
+ ->(val) { val.instance_of? String })
188
+ )
189
+ end
190
+
191
+ return false unless value.instance_of? Hash
192
+
193
+ (
194
+ APIHelper.valid_type?(value['id'],
195
+ ->(val) { val.instance_of? String }) and
196
+ APIHelper.valid_type?(value['workspace_id'],
197
+ ->(val) { val.instance_of? String }) and
198
+ APIHelper.valid_type?(value['classification'],
199
+ ->(val) { ClassificationEnum.validate(val) }) and
200
+ APIHelper.valid_type?(value['created_at'],
201
+ ->(val) { val.instance_of? String }) and
202
+ APIHelper.valid_type?(value['updated_at'],
203
+ ->(val) { val.instance_of? String })
204
+ )
205
+ end
206
+
207
+ # Provides a human-readable string representation of the object.
208
+ def to_s
209
+ class_name = self.class.name.split('::').last
210
+ super_string = super().sub(/^<[^ ]+ /, '').sub(/>$/, '')
211
+ "<#{class_name} #{super_string}>"
212
+ end
213
+
214
+ # Provides a debugging-friendly string with detailed object information.
215
+ def inspect
216
+ class_name = self.class.name.split('::').last
217
+ super_string = super().inspect.sub(/^<[^ ]+ /, '').sub(/>$/, '')
218
+ "<#{class_name} #{super_string}>"
219
+ end
220
+ end
221
+ end