treezor_client 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -5
- data/Gemfile.lock +4 -6
- data/README.md +19 -5
- data/config.json +10 -0
- data/docs/BalanceApi.md +8 -8
- data/docs/BankaccountApi.md +30 -30
- data/docs/BeneficiariesApi.md +30 -30
- data/docs/Beneficiary.md +1 -0
- data/docs/BusinessApi.md +26 -26
- data/docs/Card.md +2 -2
- data/docs/CardApi.md +209 -150
- data/docs/CardDigitalization.md +1 -3
- data/docs/CardDigitalizationsApi.md +73 -16
- data/docs/CardReserveApi.md +24 -24
- data/docs/CardtransactionApi.md +16 -14
- data/docs/CountryRestrictionGroup.md +14 -0
- data/docs/CountryRestrictionGroupsApi.md +40 -40
- data/docs/Document.md +1 -0
- data/docs/DocumentApi.md +46 -44
- data/docs/HeartbeatApi.md +8 -8
- data/docs/InlineResponse20010Cardtransactions.md +3 -3
- data/docs/InlineResponse20011.md +1 -1
- data/docs/InlineResponse20011Cardtransactions.md +58 -0
- data/docs/InlineResponse20012.md +1 -1
- data/docs/InlineResponse20013.md +1 -1
- data/docs/InlineResponse20014.md +1 -1
- data/docs/InlineResponse20015.md +1 -1
- data/docs/InlineResponse20016.md +1 -1
- data/docs/InlineResponse20017.md +1 -1
- data/docs/InlineResponse20018.md +1 -1
- data/docs/InlineResponse20019.md +1 -1
- data/docs/InlineResponse20020.md +1 -1
- data/docs/InlineResponse20021.md +1 -1
- data/docs/InlineResponse20022.md +1 -1
- data/docs/InlineResponse20023.md +1 -1
- data/docs/InlineResponse20024.md +1 -1
- data/docs/InlineResponse20025.md +1 -1
- data/docs/InlineResponse20026.md +8 -0
- data/docs/InlineResponse20027.md +8 -0
- data/docs/InlineResponse20028.md +8 -0
- data/docs/InlineResponse2005Businessinformations.md +2 -2
- data/docs/IssuerInitiatedDigitizationDataApi.md +22 -22
- data/docs/MandateApi.md +50 -50
- data/docs/MccRestrictionGroupsApi.md +40 -40
- data/docs/MerchantIdRestrictionGroupsApi.md +40 -40
- data/docs/PayinApi.md +38 -38
- data/docs/PayinrefundApi.md +38 -38
- data/docs/PayoutApi.md +38 -38
- data/docs/PayoutRefund.md +22 -0
- data/docs/PayoutRefundsApi.md +82 -0
- data/docs/TaxResidence.md +15 -0
- data/docs/TaxResidenceApi.md +319 -0
- data/docs/TransactionApi.md +22 -22
- data/docs/TransferApi.md +42 -42
- data/docs/TransferrefundApi.md +42 -42
- data/docs/User.md +3 -0
- data/docs/UserApi.md +104 -85
- data/docs/VirtualibansApi.md +46 -46
- data/docs/WalletApi.md +84 -84
- data/lib/treezor_client/api/balance_api.rb +8 -8
- data/lib/treezor_client/api/bankaccount_api.rb +30 -30
- data/lib/treezor_client/api/beneficiaries_api.rb +30 -30
- data/lib/treezor_client/api/business_api.rb +26 -26
- data/lib/treezor_client/api/card_api.rb +209 -154
- data/lib/treezor_client/api/card_digitalizations_api.rb +82 -16
- data/lib/treezor_client/api/card_reserve_api.rb +24 -24
- data/lib/treezor_client/api/cardtransaction_api.rb +18 -15
- data/lib/treezor_client/api/country_restriction_groups_api.rb +45 -45
- data/lib/treezor_client/api/document_api.rb +64 -57
- data/lib/treezor_client/api/heartbeat_api.rb +8 -8
- data/lib/treezor_client/api/issuer_initiated_digitization_data_api.rb +22 -22
- data/lib/treezor_client/api/mandate_api.rb +58 -58
- data/lib/treezor_client/api/mcc_restriction_groups_api.rb +45 -45
- data/lib/treezor_client/api/merchant_id_restriction_groups_api.rb +45 -45
- data/lib/treezor_client/api/payin_api.rb +42 -42
- data/lib/treezor_client/api/payinrefund_api.rb +42 -42
- data/lib/treezor_client/api/payout_api.rb +42 -42
- data/lib/treezor_client/api/payout_refunds_api.rb +102 -0
- data/lib/treezor_client/api/tax_residence_api.rb +319 -0
- data/lib/treezor_client/api/transaction_api.rb +24 -24
- data/lib/treezor_client/api/transfer_api.rb +46 -46
- data/lib/treezor_client/api/transferrefund_api.rb +46 -46
- data/lib/treezor_client/api/user_api.rb +124 -93
- data/lib/treezor_client/api/virtualibans_api.rb +50 -50
- data/lib/treezor_client/api/wallet_api.rb +89 -89
- data/lib/treezor_client/models/beneficiary.rb +11 -1
- data/lib/treezor_client/models/card.rb +2 -2
- data/lib/treezor_client/models/card_digitalization.rb +3 -20
- data/lib/treezor_client/models/country_restriction_group.rb +284 -0
- data/lib/treezor_client/models/document.rb +10 -1
- data/lib/treezor_client/models/inline_response_200_10_cardtransactions.rb +3 -3
- data/lib/treezor_client/models/inline_response_200_11.rb +8 -8
- data/lib/treezor_client/models/inline_response_200_11_cardtransactions.rb +642 -0
- data/lib/treezor_client/models/inline_response_200_12.rb +8 -8
- data/lib/treezor_client/models/inline_response_200_13.rb +8 -8
- data/lib/treezor_client/models/inline_response_200_14.rb +1 -1
- data/lib/treezor_client/models/inline_response_200_15.rb +1 -1
- data/lib/treezor_client/models/inline_response_200_16.rb +8 -8
- data/lib/treezor_client/models/inline_response_200_17.rb +8 -8
- data/lib/treezor_client/models/inline_response_200_18.rb +8 -8
- data/lib/treezor_client/models/inline_response_200_19.rb +8 -8
- data/lib/treezor_client/models/inline_response_200_20.rb +8 -8
- data/lib/treezor_client/models/inline_response_200_21.rb +8 -8
- data/lib/treezor_client/models/inline_response_200_22.rb +8 -8
- data/lib/treezor_client/models/inline_response_200_23.rb +1 -1
- data/lib/treezor_client/models/inline_response_200_24.rb +8 -8
- data/lib/treezor_client/models/inline_response_200_25.rb +8 -8
- data/lib/treezor_client/models/inline_response_200_26.rb +190 -0
- data/lib/treezor_client/models/inline_response_200_27.rb +190 -0
- data/lib/treezor_client/models/inline_response_200_28.rb +190 -0
- data/lib/treezor_client/models/inline_response_200_5_businessinformations.rb +2 -2
- data/lib/treezor_client/models/payout_refund.rb +347 -0
- data/lib/treezor_client/models/tax_residence.rb +259 -0
- data/lib/treezor_client/models/user.rb +28 -1
- data/lib/treezor_client/version.rb +1 -1
- data/lib/treezor_client.rb +9 -1
- data/pkg/treezor_client-1.0.0.gem +0 -0
- data/pkg/treezor_client-1.1.0.gem +0 -0
- data/pkg/treezor_client-1.2.0.gem +0 -0
- data/spec/api/balance_api_spec.rb +4 -4
- data/spec/api/bankaccount_api_spec.rb +15 -15
- data/spec/api/beneficiaries_api_spec.rb +15 -15
- data/spec/api/business_api_spec.rb +13 -13
- data/spec/api/card_api_spec.rb +93 -75
- data/spec/api/card_digitalizations_api_spec.rb +19 -6
- data/spec/api/card_reserve_api_spec.rb +12 -12
- data/spec/api/cardtransaction_api_spec.rb +8 -7
- data/spec/api/country_restriction_groups_api_spec.rb +20 -20
- data/spec/api/document_api_spec.rb +22 -21
- data/spec/api/heartbeat_api_spec.rb +4 -4
- data/spec/api/issuer_initiated_digitization_data_api_spec.rb +11 -11
- data/spec/api/mandate_api_spec.rb +26 -26
- data/spec/api/mcc_restriction_groups_api_spec.rb +20 -20
- data/spec/api/merchant_id_restriction_groups_api_spec.rb +20 -22
- data/spec/api/payin_api_spec.rb +19 -19
- data/spec/api/payinrefund_api_spec.rb +19 -19
- data/spec/api/payout_api_spec.rb +19 -19
- data/spec/api/payout_refunds_api_spec.rb +56 -0
- data/spec/api/tax_residence_api_spec.rb +108 -0
- data/spec/api/transaction_api_spec.rb +11 -11
- data/spec/api/transfer_api_spec.rb +21 -21
- data/spec/api/transferrefund_api_spec.rb +21 -21
- data/spec/api/user_api_spec.rb +58 -41
- data/spec/api/virtualibans_api_spec.rb +23 -23
- data/spec/api/wallet_api_spec.rb +42 -42
- data/spec/models/beneficiary_spec.rb +6 -0
- data/spec/models/card_digitalization_spec.rb +0 -12
- data/spec/models/card_spec.rb +6 -0
- data/spec/models/country_restriction_group_spec.rb +82 -0
- data/spec/models/document_spec.rb +6 -0
- data/spec/models/inline_response_200_11_cardtransactions_spec.rb +342 -0
- data/spec/models/inline_response_200_11_spec.rb +1 -1
- data/spec/models/inline_response_200_12_spec.rb +1 -1
- data/spec/models/inline_response_200_13_spec.rb +1 -1
- data/spec/models/inline_response_200_16_spec.rb +1 -1
- data/spec/models/inline_response_200_17_spec.rb +1 -1
- data/spec/models/inline_response_200_18_spec.rb +1 -1
- data/spec/models/inline_response_200_19_spec.rb +1 -1
- data/spec/models/inline_response_200_20_spec.rb +1 -1
- data/spec/models/inline_response_200_21_spec.rb +1 -1
- data/spec/models/inline_response_200_22_spec.rb +1 -1
- data/spec/models/inline_response_200_24_spec.rb +1 -1
- data/spec/models/inline_response_200_25_spec.rb +1 -1
- data/spec/models/inline_response_200_26_spec.rb +42 -0
- data/spec/models/inline_response_200_27_spec.rb +42 -0
- data/spec/models/inline_response_200_28_spec.rb +42 -0
- data/spec/models/issuer_initiated_digitization_datas_additionnal_data_spec.rb +1 -1
- data/spec/models/merchant_id_restriction_group_spec.rb +1 -1
- data/spec/models/payout_refund_spec.rb +130 -0
- data/spec/models/tax_residence_spec.rb +84 -0
- data/spec/models/user_spec.rb +42 -0
- data/treezor_api_spec.yaml +1841 -1207
- data/treezor_client.gemspec +1 -3
- metadata +45 -9
- data/spec/models/card_digitalization_details_from_gps_spec.rb +0 -234
- data/spec/models/issuer_initiated_digitization_datas_additionnal_data_ecc_public_certificates_spec.rb +0 -54
@@ -0,0 +1,347 @@
|
|
1
|
+
=begin
|
2
|
+
#Treezor
|
3
|
+
|
4
|
+
#Treezor API. more info [here](https://www.treezor.com).
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.1.1
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module TreezorClient
|
16
|
+
|
17
|
+
class PayoutRefund
|
18
|
+
attr_accessor :id
|
19
|
+
|
20
|
+
attr_accessor :tag
|
21
|
+
|
22
|
+
attr_accessor :code_status
|
23
|
+
|
24
|
+
attr_accessor :information_status
|
25
|
+
|
26
|
+
attr_accessor :payout_id
|
27
|
+
|
28
|
+
attr_accessor :request_amount
|
29
|
+
|
30
|
+
attr_accessor :request_currency
|
31
|
+
|
32
|
+
attr_accessor :request_comment
|
33
|
+
|
34
|
+
attr_accessor :reason_code
|
35
|
+
|
36
|
+
attr_accessor :refund_amount
|
37
|
+
|
38
|
+
attr_accessor :refund_currency
|
39
|
+
|
40
|
+
attr_accessor :refund_date
|
41
|
+
|
42
|
+
attr_accessor :refund_comment
|
43
|
+
|
44
|
+
attr_accessor :created_date
|
45
|
+
|
46
|
+
attr_accessor :modified_date
|
47
|
+
|
48
|
+
class EnumAttributeValidator
|
49
|
+
attr_reader :datatype
|
50
|
+
attr_reader :allowable_values
|
51
|
+
|
52
|
+
def initialize(datatype, allowable_values)
|
53
|
+
@allowable_values = allowable_values.map do |value|
|
54
|
+
case datatype.to_s
|
55
|
+
when /Integer/i
|
56
|
+
value.to_i
|
57
|
+
when /Float/i
|
58
|
+
value.to_f
|
59
|
+
else
|
60
|
+
value
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def valid?(value)
|
66
|
+
!value || allowable_values.include?(value)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
71
|
+
def self.attribute_map
|
72
|
+
{
|
73
|
+
:'id' => :'id',
|
74
|
+
:'tag' => :'tag',
|
75
|
+
:'code_status' => :'codeStatus',
|
76
|
+
:'information_status' => :'informationStatus',
|
77
|
+
:'payout_id' => :'payoutId',
|
78
|
+
:'request_amount' => :'requestAmount',
|
79
|
+
:'request_currency' => :'requestCurrency',
|
80
|
+
:'request_comment' => :'requestComment',
|
81
|
+
:'reason_code' => :'reasonCode',
|
82
|
+
:'refund_amount' => :'refundAmount',
|
83
|
+
:'refund_currency' => :'refundCurrency',
|
84
|
+
:'refund_date' => :'refundDate',
|
85
|
+
:'refund_comment' => :'refundComment',
|
86
|
+
:'created_date' => :'createdDate',
|
87
|
+
:'modified_date' => :'modifiedDate'
|
88
|
+
}
|
89
|
+
end
|
90
|
+
|
91
|
+
# Attribute type mapping.
|
92
|
+
def self.swagger_types
|
93
|
+
{
|
94
|
+
:'id' => :'Integer',
|
95
|
+
:'tag' => :'String',
|
96
|
+
:'code_status' => :'Integer',
|
97
|
+
:'information_status' => :'String',
|
98
|
+
:'payout_id' => :'Integer',
|
99
|
+
:'request_amount' => :'String',
|
100
|
+
:'request_currency' => :'String',
|
101
|
+
:'request_comment' => :'String',
|
102
|
+
:'reason_code' => :'String',
|
103
|
+
:'refund_amount' => :'String',
|
104
|
+
:'refund_currency' => :'String',
|
105
|
+
:'refund_date' => :'String',
|
106
|
+
:'refund_comment' => :'String',
|
107
|
+
:'created_date' => :'String',
|
108
|
+
:'modified_date' => :'String'
|
109
|
+
}
|
110
|
+
end
|
111
|
+
|
112
|
+
# Initializes the object
|
113
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
114
|
+
def initialize(attributes = {})
|
115
|
+
return unless attributes.is_a?(Hash)
|
116
|
+
|
117
|
+
# convert string to symbol for hash key
|
118
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
119
|
+
|
120
|
+
if attributes.has_key?(:'id')
|
121
|
+
self.id = attributes[:'id']
|
122
|
+
end
|
123
|
+
|
124
|
+
if attributes.has_key?(:'tag')
|
125
|
+
self.tag = attributes[:'tag']
|
126
|
+
end
|
127
|
+
|
128
|
+
if attributes.has_key?(:'codeStatus')
|
129
|
+
self.code_status = attributes[:'codeStatus']
|
130
|
+
end
|
131
|
+
|
132
|
+
if attributes.has_key?(:'informationStatus')
|
133
|
+
self.information_status = attributes[:'informationStatus']
|
134
|
+
end
|
135
|
+
|
136
|
+
if attributes.has_key?(:'payoutId')
|
137
|
+
self.payout_id = attributes[:'payoutId']
|
138
|
+
end
|
139
|
+
|
140
|
+
if attributes.has_key?(:'requestAmount')
|
141
|
+
self.request_amount = attributes[:'requestAmount']
|
142
|
+
end
|
143
|
+
|
144
|
+
if attributes.has_key?(:'requestCurrency')
|
145
|
+
self.request_currency = attributes[:'requestCurrency']
|
146
|
+
end
|
147
|
+
|
148
|
+
if attributes.has_key?(:'requestComment')
|
149
|
+
self.request_comment = attributes[:'requestComment']
|
150
|
+
end
|
151
|
+
|
152
|
+
if attributes.has_key?(:'reasonCode')
|
153
|
+
self.reason_code = attributes[:'reasonCode']
|
154
|
+
end
|
155
|
+
|
156
|
+
if attributes.has_key?(:'refundAmount')
|
157
|
+
self.refund_amount = attributes[:'refundAmount']
|
158
|
+
end
|
159
|
+
|
160
|
+
if attributes.has_key?(:'refundCurrency')
|
161
|
+
self.refund_currency = attributes[:'refundCurrency']
|
162
|
+
end
|
163
|
+
|
164
|
+
if attributes.has_key?(:'refundDate')
|
165
|
+
self.refund_date = attributes[:'refundDate']
|
166
|
+
end
|
167
|
+
|
168
|
+
if attributes.has_key?(:'refundComment')
|
169
|
+
self.refund_comment = attributes[:'refundComment']
|
170
|
+
end
|
171
|
+
|
172
|
+
if attributes.has_key?(:'createdDate')
|
173
|
+
self.created_date = attributes[:'createdDate']
|
174
|
+
end
|
175
|
+
|
176
|
+
if attributes.has_key?(:'modifiedDate')
|
177
|
+
self.modified_date = attributes[:'modifiedDate']
|
178
|
+
end
|
179
|
+
|
180
|
+
end
|
181
|
+
|
182
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
183
|
+
# @return Array for valid properties with the reasons
|
184
|
+
def list_invalid_properties
|
185
|
+
invalid_properties = Array.new
|
186
|
+
return invalid_properties
|
187
|
+
end
|
188
|
+
|
189
|
+
# Check to see if the all the properties in the model are valid
|
190
|
+
# @return true if the model is valid
|
191
|
+
def valid?
|
192
|
+
information_status_validator = EnumAttributeValidator.new('String', ["PENDING", "CANCELED", "VALIDATED"])
|
193
|
+
return false unless information_status_validator.valid?(@information_status)
|
194
|
+
return true
|
195
|
+
end
|
196
|
+
|
197
|
+
# Custom attribute writer method checking allowed values (enum).
|
198
|
+
# @param [Object] information_status Object to be assigned
|
199
|
+
def information_status=(information_status)
|
200
|
+
validator = EnumAttributeValidator.new('String', ["PENDING", "CANCELED", "VALIDATED"])
|
201
|
+
unless validator.valid?(information_status)
|
202
|
+
fail ArgumentError, "invalid value for 'information_status', must be one of #{validator.allowable_values}."
|
203
|
+
end
|
204
|
+
@information_status = information_status
|
205
|
+
end
|
206
|
+
|
207
|
+
# Checks equality by comparing each attribute.
|
208
|
+
# @param [Object] Object to be compared
|
209
|
+
def ==(o)
|
210
|
+
return true if self.equal?(o)
|
211
|
+
self.class == o.class &&
|
212
|
+
id == o.id &&
|
213
|
+
tag == o.tag &&
|
214
|
+
code_status == o.code_status &&
|
215
|
+
information_status == o.information_status &&
|
216
|
+
payout_id == o.payout_id &&
|
217
|
+
request_amount == o.request_amount &&
|
218
|
+
request_currency == o.request_currency &&
|
219
|
+
request_comment == o.request_comment &&
|
220
|
+
reason_code == o.reason_code &&
|
221
|
+
refund_amount == o.refund_amount &&
|
222
|
+
refund_currency == o.refund_currency &&
|
223
|
+
refund_date == o.refund_date &&
|
224
|
+
refund_comment == o.refund_comment &&
|
225
|
+
created_date == o.created_date &&
|
226
|
+
modified_date == o.modified_date
|
227
|
+
end
|
228
|
+
|
229
|
+
# @see the `==` method
|
230
|
+
# @param [Object] Object to be compared
|
231
|
+
def eql?(o)
|
232
|
+
self == o
|
233
|
+
end
|
234
|
+
|
235
|
+
# Calculates hash code according to all attributes.
|
236
|
+
# @return [Fixnum] Hash code
|
237
|
+
def hash
|
238
|
+
[id, tag, code_status, information_status, payout_id, request_amount, request_currency, request_comment, reason_code, refund_amount, refund_currency, refund_date, refund_comment, created_date, modified_date].hash
|
239
|
+
end
|
240
|
+
|
241
|
+
# Builds the object from hash
|
242
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
243
|
+
# @return [Object] Returns the model itself
|
244
|
+
def build_from_hash(attributes)
|
245
|
+
return nil unless attributes.is_a?(Hash)
|
246
|
+
self.class.swagger_types.each_pair do |key, type|
|
247
|
+
if type =~ /\AArray<(.*)>/i
|
248
|
+
# check to ensure the input is an array given that the the attribute
|
249
|
+
# is documented as an array but the input is not
|
250
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
251
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
252
|
+
end
|
253
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
254
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
255
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
256
|
+
end
|
257
|
+
|
258
|
+
self
|
259
|
+
end
|
260
|
+
|
261
|
+
# Deserializes the data based on type
|
262
|
+
# @param string type Data type
|
263
|
+
# @param string value Value to be deserialized
|
264
|
+
# @return [Object] Deserialized data
|
265
|
+
def _deserialize(type, value)
|
266
|
+
case type.to_sym
|
267
|
+
when :DateTime
|
268
|
+
DateTime.parse(value)
|
269
|
+
when :Date
|
270
|
+
Date.parse(value)
|
271
|
+
when :String
|
272
|
+
value.to_s
|
273
|
+
when :Integer
|
274
|
+
value.to_i
|
275
|
+
when :Float
|
276
|
+
value.to_f
|
277
|
+
when :BOOLEAN
|
278
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
279
|
+
true
|
280
|
+
else
|
281
|
+
false
|
282
|
+
end
|
283
|
+
when :Object
|
284
|
+
# generic object (usually a Hash), return directly
|
285
|
+
value
|
286
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
287
|
+
inner_type = Regexp.last_match[:inner_type]
|
288
|
+
value.map { |v| _deserialize(inner_type, v) }
|
289
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
290
|
+
k_type = Regexp.last_match[:k_type]
|
291
|
+
v_type = Regexp.last_match[:v_type]
|
292
|
+
{}.tap do |hash|
|
293
|
+
value.each do |k, v|
|
294
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
295
|
+
end
|
296
|
+
end
|
297
|
+
else # model
|
298
|
+
temp_model = TreezorClient.const_get(type).new
|
299
|
+
temp_model.build_from_hash(value)
|
300
|
+
end
|
301
|
+
end
|
302
|
+
|
303
|
+
# Returns the string representation of the object
|
304
|
+
# @return [String] String presentation of the object
|
305
|
+
def to_s
|
306
|
+
to_hash.to_s
|
307
|
+
end
|
308
|
+
|
309
|
+
# to_body is an alias to to_hash (backward compatibility)
|
310
|
+
# @return [Hash] Returns the object in the form of hash
|
311
|
+
def to_body
|
312
|
+
to_hash
|
313
|
+
end
|
314
|
+
|
315
|
+
# Returns the object in the form of hash
|
316
|
+
# @return [Hash] Returns the object in the form of hash
|
317
|
+
def to_hash
|
318
|
+
hash = {}
|
319
|
+
self.class.attribute_map.each_pair do |attr, param|
|
320
|
+
value = self.send(attr)
|
321
|
+
next if value.nil?
|
322
|
+
hash[param] = _to_hash(value)
|
323
|
+
end
|
324
|
+
hash
|
325
|
+
end
|
326
|
+
|
327
|
+
# Outputs non-array value in the form of hash
|
328
|
+
# For object, use to_hash. Otherwise, just return the value
|
329
|
+
# @param [Object] value Any valid value
|
330
|
+
# @return [Hash] Returns the value in the form of hash
|
331
|
+
def _to_hash(value)
|
332
|
+
if value.is_a?(Array)
|
333
|
+
value.compact.map{ |v| _to_hash(v) }
|
334
|
+
elsif value.is_a?(Hash)
|
335
|
+
{}.tap do |hash|
|
336
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
337
|
+
end
|
338
|
+
elsif value.respond_to? :to_hash
|
339
|
+
value.to_hash
|
340
|
+
else
|
341
|
+
value
|
342
|
+
end
|
343
|
+
end
|
344
|
+
|
345
|
+
end
|
346
|
+
|
347
|
+
end
|
@@ -0,0 +1,259 @@
|
|
1
|
+
=begin
|
2
|
+
#Treezor
|
3
|
+
|
4
|
+
#Treezor API. more info [here](https://www.treezor.com).
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.1.1
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module TreezorClient
|
16
|
+
|
17
|
+
class TaxResidence
|
18
|
+
# TaxResidence Id
|
19
|
+
attr_accessor :id
|
20
|
+
|
21
|
+
# The user id
|
22
|
+
attr_accessor :user_id
|
23
|
+
|
24
|
+
# The residence country
|
25
|
+
attr_accessor :country
|
26
|
+
|
27
|
+
# the taxPayer id
|
28
|
+
attr_accessor :tax_payer_id
|
29
|
+
|
30
|
+
# Tax declaration
|
31
|
+
attr_accessor :liability_waiver
|
32
|
+
|
33
|
+
# Date of creation
|
34
|
+
attr_accessor :created_date
|
35
|
+
|
36
|
+
# Date of the TaxResidence has been updated
|
37
|
+
attr_accessor :last_update
|
38
|
+
|
39
|
+
# Date of the TaxResidence has been deleted
|
40
|
+
attr_accessor :deleted_date
|
41
|
+
|
42
|
+
|
43
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
44
|
+
def self.attribute_map
|
45
|
+
{
|
46
|
+
:'id' => :'id',
|
47
|
+
:'user_id' => :'userId',
|
48
|
+
:'country' => :'country',
|
49
|
+
:'tax_payer_id' => :'taxPayerId',
|
50
|
+
:'liability_waiver' => :'liabilityWaiver',
|
51
|
+
:'created_date' => :'createdDate',
|
52
|
+
:'last_update' => :'lastUpdate',
|
53
|
+
:'deleted_date' => :'deletedDate'
|
54
|
+
}
|
55
|
+
end
|
56
|
+
|
57
|
+
# Attribute type mapping.
|
58
|
+
def self.swagger_types
|
59
|
+
{
|
60
|
+
:'id' => :'Integer',
|
61
|
+
:'user_id' => :'Integer',
|
62
|
+
:'country' => :'String',
|
63
|
+
:'tax_payer_id' => :'String',
|
64
|
+
:'liability_waiver' => :'BOOLEAN',
|
65
|
+
:'created_date' => :'String',
|
66
|
+
:'last_update' => :'String',
|
67
|
+
:'deleted_date' => :'String'
|
68
|
+
}
|
69
|
+
end
|
70
|
+
|
71
|
+
# Initializes the object
|
72
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
73
|
+
def initialize(attributes = {})
|
74
|
+
return unless attributes.is_a?(Hash)
|
75
|
+
|
76
|
+
# convert string to symbol for hash key
|
77
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
78
|
+
|
79
|
+
if attributes.has_key?(:'id')
|
80
|
+
self.id = attributes[:'id']
|
81
|
+
end
|
82
|
+
|
83
|
+
if attributes.has_key?(:'userId')
|
84
|
+
self.user_id = attributes[:'userId']
|
85
|
+
end
|
86
|
+
|
87
|
+
if attributes.has_key?(:'country')
|
88
|
+
self.country = attributes[:'country']
|
89
|
+
end
|
90
|
+
|
91
|
+
if attributes.has_key?(:'taxPayerId')
|
92
|
+
self.tax_payer_id = attributes[:'taxPayerId']
|
93
|
+
end
|
94
|
+
|
95
|
+
if attributes.has_key?(:'liabilityWaiver')
|
96
|
+
self.liability_waiver = attributes[:'liabilityWaiver']
|
97
|
+
end
|
98
|
+
|
99
|
+
if attributes.has_key?(:'createdDate')
|
100
|
+
self.created_date = attributes[:'createdDate']
|
101
|
+
end
|
102
|
+
|
103
|
+
if attributes.has_key?(:'lastUpdate')
|
104
|
+
self.last_update = attributes[:'lastUpdate']
|
105
|
+
end
|
106
|
+
|
107
|
+
if attributes.has_key?(:'deletedDate')
|
108
|
+
self.deleted_date = attributes[:'deletedDate']
|
109
|
+
end
|
110
|
+
|
111
|
+
end
|
112
|
+
|
113
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
114
|
+
# @return Array for valid properties with the reasons
|
115
|
+
def list_invalid_properties
|
116
|
+
invalid_properties = Array.new
|
117
|
+
return invalid_properties
|
118
|
+
end
|
119
|
+
|
120
|
+
# Check to see if the all the properties in the model are valid
|
121
|
+
# @return true if the model is valid
|
122
|
+
def valid?
|
123
|
+
return true
|
124
|
+
end
|
125
|
+
|
126
|
+
# Checks equality by comparing each attribute.
|
127
|
+
# @param [Object] Object to be compared
|
128
|
+
def ==(o)
|
129
|
+
return true if self.equal?(o)
|
130
|
+
self.class == o.class &&
|
131
|
+
id == o.id &&
|
132
|
+
user_id == o.user_id &&
|
133
|
+
country == o.country &&
|
134
|
+
tax_payer_id == o.tax_payer_id &&
|
135
|
+
liability_waiver == o.liability_waiver &&
|
136
|
+
created_date == o.created_date &&
|
137
|
+
last_update == o.last_update &&
|
138
|
+
deleted_date == o.deleted_date
|
139
|
+
end
|
140
|
+
|
141
|
+
# @see the `==` method
|
142
|
+
# @param [Object] Object to be compared
|
143
|
+
def eql?(o)
|
144
|
+
self == o
|
145
|
+
end
|
146
|
+
|
147
|
+
# Calculates hash code according to all attributes.
|
148
|
+
# @return [Fixnum] Hash code
|
149
|
+
def hash
|
150
|
+
[id, user_id, country, tax_payer_id, liability_waiver, created_date, last_update, deleted_date].hash
|
151
|
+
end
|
152
|
+
|
153
|
+
# Builds the object from hash
|
154
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
155
|
+
# @return [Object] Returns the model itself
|
156
|
+
def build_from_hash(attributes)
|
157
|
+
return nil unless attributes.is_a?(Hash)
|
158
|
+
self.class.swagger_types.each_pair do |key, type|
|
159
|
+
if type =~ /\AArray<(.*)>/i
|
160
|
+
# check to ensure the input is an array given that the the attribute
|
161
|
+
# is documented as an array but the input is not
|
162
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
163
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
164
|
+
end
|
165
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
166
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
167
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
168
|
+
end
|
169
|
+
|
170
|
+
self
|
171
|
+
end
|
172
|
+
|
173
|
+
# Deserializes the data based on type
|
174
|
+
# @param string type Data type
|
175
|
+
# @param string value Value to be deserialized
|
176
|
+
# @return [Object] Deserialized data
|
177
|
+
def _deserialize(type, value)
|
178
|
+
case type.to_sym
|
179
|
+
when :DateTime
|
180
|
+
DateTime.parse(value)
|
181
|
+
when :Date
|
182
|
+
Date.parse(value)
|
183
|
+
when :String
|
184
|
+
value.to_s
|
185
|
+
when :Integer
|
186
|
+
value.to_i
|
187
|
+
when :Float
|
188
|
+
value.to_f
|
189
|
+
when :BOOLEAN
|
190
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
191
|
+
true
|
192
|
+
else
|
193
|
+
false
|
194
|
+
end
|
195
|
+
when :Object
|
196
|
+
# generic object (usually a Hash), return directly
|
197
|
+
value
|
198
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
199
|
+
inner_type = Regexp.last_match[:inner_type]
|
200
|
+
value.map { |v| _deserialize(inner_type, v) }
|
201
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
202
|
+
k_type = Regexp.last_match[:k_type]
|
203
|
+
v_type = Regexp.last_match[:v_type]
|
204
|
+
{}.tap do |hash|
|
205
|
+
value.each do |k, v|
|
206
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
207
|
+
end
|
208
|
+
end
|
209
|
+
else # model
|
210
|
+
temp_model = TreezorClient.const_get(type).new
|
211
|
+
temp_model.build_from_hash(value)
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
215
|
+
# Returns the string representation of the object
|
216
|
+
# @return [String] String presentation of the object
|
217
|
+
def to_s
|
218
|
+
to_hash.to_s
|
219
|
+
end
|
220
|
+
|
221
|
+
# to_body is an alias to to_hash (backward compatibility)
|
222
|
+
# @return [Hash] Returns the object in the form of hash
|
223
|
+
def to_body
|
224
|
+
to_hash
|
225
|
+
end
|
226
|
+
|
227
|
+
# Returns the object in the form of hash
|
228
|
+
# @return [Hash] Returns the object in the form of hash
|
229
|
+
def to_hash
|
230
|
+
hash = {}
|
231
|
+
self.class.attribute_map.each_pair do |attr, param|
|
232
|
+
value = self.send(attr)
|
233
|
+
next if value.nil?
|
234
|
+
hash[param] = _to_hash(value)
|
235
|
+
end
|
236
|
+
hash
|
237
|
+
end
|
238
|
+
|
239
|
+
# Outputs non-array value in the form of hash
|
240
|
+
# For object, use to_hash. Otherwise, just return the value
|
241
|
+
# @param [Object] value Any valid value
|
242
|
+
# @return [Hash] Returns the value in the form of hash
|
243
|
+
def _to_hash(value)
|
244
|
+
if value.is_a?(Array)
|
245
|
+
value.compact.map{ |v| _to_hash(v) }
|
246
|
+
elsif value.is_a?(Hash)
|
247
|
+
{}.tap do |hash|
|
248
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
249
|
+
end
|
250
|
+
elsif value.respond_to? :to_hash
|
251
|
+
value.to_hash
|
252
|
+
else
|
253
|
+
value
|
254
|
+
end
|
255
|
+
end
|
256
|
+
|
257
|
+
end
|
258
|
+
|
259
|
+
end
|
@@ -27,6 +27,12 @@ module TreezorClient
|
|
27
27
|
|
28
28
|
attr_accessor :parent_type
|
29
29
|
|
30
|
+
attr_accessor :controlling_person_type
|
31
|
+
|
32
|
+
attr_accessor :employee_type
|
33
|
+
|
34
|
+
attr_accessor :specified_us_person
|
35
|
+
|
30
36
|
attr_accessor :title
|
31
37
|
|
32
38
|
attr_accessor :firstname
|
@@ -161,6 +167,9 @@ module TreezorClient
|
|
161
167
|
:'user_tag' => :'userTag',
|
162
168
|
:'parent_user_id' => :'parentUserId',
|
163
169
|
:'parent_type' => :'parentType',
|
170
|
+
:'controlling_person_type' => :'controllingPersonType',
|
171
|
+
:'employee_type' => :'employeeType',
|
172
|
+
:'specified_us_person' => :'specifiedUSPerson',
|
164
173
|
:'title' => :'title',
|
165
174
|
:'firstname' => :'firstname',
|
166
175
|
:'lastname' => :'lastname',
|
@@ -222,6 +231,9 @@ module TreezorClient
|
|
222
231
|
:'user_tag' => :'String',
|
223
232
|
:'parent_user_id' => :'Integer',
|
224
233
|
:'parent_type' => :'String',
|
234
|
+
:'controlling_person_type' => :'Integer',
|
235
|
+
:'employee_type' => :'Integer',
|
236
|
+
:'specified_us_person' => :'Integer',
|
225
237
|
:'title' => :'String',
|
226
238
|
:'firstname' => :'String',
|
227
239
|
:'lastname' => :'String',
|
@@ -306,6 +318,18 @@ module TreezorClient
|
|
306
318
|
self.parent_type = attributes[:'parentType']
|
307
319
|
end
|
308
320
|
|
321
|
+
if attributes.has_key?(:'controllingPersonType')
|
322
|
+
self.controlling_person_type = attributes[:'controllingPersonType']
|
323
|
+
end
|
324
|
+
|
325
|
+
if attributes.has_key?(:'employeeType')
|
326
|
+
self.employee_type = attributes[:'employeeType']
|
327
|
+
end
|
328
|
+
|
329
|
+
if attributes.has_key?(:'specifiedUSPerson')
|
330
|
+
self.specified_us_person = attributes[:'specifiedUSPerson']
|
331
|
+
end
|
332
|
+
|
309
333
|
if attributes.has_key?(:'title')
|
310
334
|
self.title = attributes[:'title']
|
311
335
|
end
|
@@ -552,6 +576,9 @@ module TreezorClient
|
|
552
576
|
user_tag == o.user_tag &&
|
553
577
|
parent_user_id == o.parent_user_id &&
|
554
578
|
parent_type == o.parent_type &&
|
579
|
+
controlling_person_type == o.controlling_person_type &&
|
580
|
+
employee_type == o.employee_type &&
|
581
|
+
specified_us_person == o.specified_us_person &&
|
555
582
|
title == o.title &&
|
556
583
|
firstname == o.firstname &&
|
557
584
|
lastname == o.lastname &&
|
@@ -612,7 +639,7 @@ module TreezorClient
|
|
612
639
|
# Calculates hash code according to all attributes.
|
613
640
|
# @return [Fixnum] Hash code
|
614
641
|
def hash
|
615
|
-
[user_id, user_type_id, user_status, user_tag, parent_user_id, parent_type, title, firstname, lastname, middle_names, birthday, email, address1, address2, postcode, city, state, country, country_name, phone, mobile, nationality, nationality_other, place_of_birth, place_country, occupation, income_range, legal_name, legal_name_embossed, legal_registration_number, legal_tva_number, legal_registration_date, legal_form, legal_share_capital, legal_sector, legal_annual_turn_over, legal_net_income_range, legal_number_of_employee_range, effective_beneficiary, kyc_level, kyc_review, kyc_review_comment, is_freezed, language, opt_in_mailing, sepa_creditor_identifier, tax_number, tax_residence, position, personal_assets, created_date, modified_date, wallet_count, payin_count, total_rows].hash
|
642
|
+
[user_id, user_type_id, user_status, user_tag, parent_user_id, parent_type, controlling_person_type, employee_type, specified_us_person, title, firstname, lastname, middle_names, birthday, email, address1, address2, postcode, city, state, country, country_name, phone, mobile, nationality, nationality_other, place_of_birth, place_country, occupation, income_range, legal_name, legal_name_embossed, legal_registration_number, legal_tva_number, legal_registration_date, legal_form, legal_share_capital, legal_sector, legal_annual_turn_over, legal_net_income_range, legal_number_of_employee_range, effective_beneficiary, kyc_level, kyc_review, kyc_review_comment, is_freezed, language, opt_in_mailing, sepa_creditor_identifier, tax_number, tax_residence, position, personal_assets, created_date, modified_date, wallet_count, payin_count, total_rows].hash
|
616
643
|
end
|
617
644
|
|
618
645
|
# Builds the object from hash
|