treezor_client 1.1.0 → 1.2.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 (177) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -5
  3. data/Gemfile.lock +4 -6
  4. data/README.md +19 -5
  5. data/config.json +10 -0
  6. data/docs/BalanceApi.md +8 -8
  7. data/docs/BankaccountApi.md +30 -30
  8. data/docs/BeneficiariesApi.md +30 -30
  9. data/docs/Beneficiary.md +1 -0
  10. data/docs/BusinessApi.md +26 -26
  11. data/docs/Card.md +2 -2
  12. data/docs/CardApi.md +209 -150
  13. data/docs/CardDigitalization.md +1 -3
  14. data/docs/CardDigitalizationsApi.md +73 -16
  15. data/docs/CardReserveApi.md +24 -24
  16. data/docs/CardtransactionApi.md +16 -14
  17. data/docs/CountryRestrictionGroup.md +14 -0
  18. data/docs/CountryRestrictionGroupsApi.md +40 -40
  19. data/docs/Document.md +1 -0
  20. data/docs/DocumentApi.md +46 -44
  21. data/docs/HeartbeatApi.md +8 -8
  22. data/docs/InlineResponse20010Cardtransactions.md +3 -3
  23. data/docs/InlineResponse20011.md +1 -1
  24. data/docs/InlineResponse20011Cardtransactions.md +58 -0
  25. data/docs/InlineResponse20012.md +1 -1
  26. data/docs/InlineResponse20013.md +1 -1
  27. data/docs/InlineResponse20014.md +1 -1
  28. data/docs/InlineResponse20015.md +1 -1
  29. data/docs/InlineResponse20016.md +1 -1
  30. data/docs/InlineResponse20017.md +1 -1
  31. data/docs/InlineResponse20018.md +1 -1
  32. data/docs/InlineResponse20019.md +1 -1
  33. data/docs/InlineResponse20020.md +1 -1
  34. data/docs/InlineResponse20021.md +1 -1
  35. data/docs/InlineResponse20022.md +1 -1
  36. data/docs/InlineResponse20023.md +1 -1
  37. data/docs/InlineResponse20024.md +1 -1
  38. data/docs/InlineResponse20025.md +1 -1
  39. data/docs/InlineResponse20026.md +8 -0
  40. data/docs/InlineResponse20027.md +8 -0
  41. data/docs/InlineResponse20028.md +8 -0
  42. data/docs/InlineResponse2005Businessinformations.md +2 -2
  43. data/docs/IssuerInitiatedDigitizationDataApi.md +22 -22
  44. data/docs/MandateApi.md +50 -50
  45. data/docs/MccRestrictionGroupsApi.md +40 -40
  46. data/docs/MerchantIdRestrictionGroupsApi.md +40 -40
  47. data/docs/PayinApi.md +38 -38
  48. data/docs/PayinrefundApi.md +38 -38
  49. data/docs/PayoutApi.md +38 -38
  50. data/docs/PayoutRefund.md +22 -0
  51. data/docs/PayoutRefundsApi.md +82 -0
  52. data/docs/TaxResidence.md +15 -0
  53. data/docs/TaxResidenceApi.md +319 -0
  54. data/docs/TransactionApi.md +22 -22
  55. data/docs/TransferApi.md +42 -42
  56. data/docs/TransferrefundApi.md +42 -42
  57. data/docs/User.md +3 -0
  58. data/docs/UserApi.md +104 -85
  59. data/docs/VirtualibansApi.md +46 -46
  60. data/docs/WalletApi.md +84 -84
  61. data/lib/treezor_client/api/balance_api.rb +8 -8
  62. data/lib/treezor_client/api/bankaccount_api.rb +30 -30
  63. data/lib/treezor_client/api/beneficiaries_api.rb +30 -30
  64. data/lib/treezor_client/api/business_api.rb +26 -26
  65. data/lib/treezor_client/api/card_api.rb +209 -154
  66. data/lib/treezor_client/api/card_digitalizations_api.rb +82 -16
  67. data/lib/treezor_client/api/card_reserve_api.rb +24 -24
  68. data/lib/treezor_client/api/cardtransaction_api.rb +18 -15
  69. data/lib/treezor_client/api/country_restriction_groups_api.rb +45 -45
  70. data/lib/treezor_client/api/document_api.rb +64 -57
  71. data/lib/treezor_client/api/heartbeat_api.rb +8 -8
  72. data/lib/treezor_client/api/issuer_initiated_digitization_data_api.rb +22 -22
  73. data/lib/treezor_client/api/mandate_api.rb +58 -58
  74. data/lib/treezor_client/api/mcc_restriction_groups_api.rb +45 -45
  75. data/lib/treezor_client/api/merchant_id_restriction_groups_api.rb +45 -45
  76. data/lib/treezor_client/api/payin_api.rb +42 -42
  77. data/lib/treezor_client/api/payinrefund_api.rb +42 -42
  78. data/lib/treezor_client/api/payout_api.rb +42 -42
  79. data/lib/treezor_client/api/payout_refunds_api.rb +102 -0
  80. data/lib/treezor_client/api/tax_residence_api.rb +319 -0
  81. data/lib/treezor_client/api/transaction_api.rb +24 -24
  82. data/lib/treezor_client/api/transfer_api.rb +46 -46
  83. data/lib/treezor_client/api/transferrefund_api.rb +46 -46
  84. data/lib/treezor_client/api/user_api.rb +124 -93
  85. data/lib/treezor_client/api/virtualibans_api.rb +50 -50
  86. data/lib/treezor_client/api/wallet_api.rb +89 -89
  87. data/lib/treezor_client/models/beneficiary.rb +11 -1
  88. data/lib/treezor_client/models/card.rb +2 -2
  89. data/lib/treezor_client/models/card_digitalization.rb +3 -20
  90. data/lib/treezor_client/models/country_restriction_group.rb +284 -0
  91. data/lib/treezor_client/models/document.rb +10 -1
  92. data/lib/treezor_client/models/inline_response_200_10_cardtransactions.rb +3 -3
  93. data/lib/treezor_client/models/inline_response_200_11.rb +8 -8
  94. data/lib/treezor_client/models/inline_response_200_11_cardtransactions.rb +642 -0
  95. data/lib/treezor_client/models/inline_response_200_12.rb +8 -8
  96. data/lib/treezor_client/models/inline_response_200_13.rb +8 -8
  97. data/lib/treezor_client/models/inline_response_200_14.rb +1 -1
  98. data/lib/treezor_client/models/inline_response_200_15.rb +1 -1
  99. data/lib/treezor_client/models/inline_response_200_16.rb +8 -8
  100. data/lib/treezor_client/models/inline_response_200_17.rb +8 -8
  101. data/lib/treezor_client/models/inline_response_200_18.rb +8 -8
  102. data/lib/treezor_client/models/inline_response_200_19.rb +8 -8
  103. data/lib/treezor_client/models/inline_response_200_20.rb +8 -8
  104. data/lib/treezor_client/models/inline_response_200_21.rb +8 -8
  105. data/lib/treezor_client/models/inline_response_200_22.rb +8 -8
  106. data/lib/treezor_client/models/inline_response_200_23.rb +1 -1
  107. data/lib/treezor_client/models/inline_response_200_24.rb +8 -8
  108. data/lib/treezor_client/models/inline_response_200_25.rb +8 -8
  109. data/lib/treezor_client/models/inline_response_200_26.rb +190 -0
  110. data/lib/treezor_client/models/inline_response_200_27.rb +190 -0
  111. data/lib/treezor_client/models/inline_response_200_28.rb +190 -0
  112. data/lib/treezor_client/models/inline_response_200_5_businessinformations.rb +2 -2
  113. data/lib/treezor_client/models/payout_refund.rb +347 -0
  114. data/lib/treezor_client/models/tax_residence.rb +259 -0
  115. data/lib/treezor_client/models/user.rb +28 -1
  116. data/lib/treezor_client/version.rb +1 -1
  117. data/lib/treezor_client.rb +9 -1
  118. data/pkg/treezor_client-1.0.0.gem +0 -0
  119. data/pkg/treezor_client-1.1.0.gem +0 -0
  120. data/pkg/treezor_client-1.2.0.gem +0 -0
  121. data/spec/api/balance_api_spec.rb +4 -4
  122. data/spec/api/bankaccount_api_spec.rb +15 -15
  123. data/spec/api/beneficiaries_api_spec.rb +15 -15
  124. data/spec/api/business_api_spec.rb +13 -13
  125. data/spec/api/card_api_spec.rb +93 -75
  126. data/spec/api/card_digitalizations_api_spec.rb +19 -6
  127. data/spec/api/card_reserve_api_spec.rb +12 -12
  128. data/spec/api/cardtransaction_api_spec.rb +8 -7
  129. data/spec/api/country_restriction_groups_api_spec.rb +20 -20
  130. data/spec/api/document_api_spec.rb +22 -21
  131. data/spec/api/heartbeat_api_spec.rb +4 -4
  132. data/spec/api/issuer_initiated_digitization_data_api_spec.rb +11 -11
  133. data/spec/api/mandate_api_spec.rb +26 -26
  134. data/spec/api/mcc_restriction_groups_api_spec.rb +20 -20
  135. data/spec/api/merchant_id_restriction_groups_api_spec.rb +20 -22
  136. data/spec/api/payin_api_spec.rb +19 -19
  137. data/spec/api/payinrefund_api_spec.rb +19 -19
  138. data/spec/api/payout_api_spec.rb +19 -19
  139. data/spec/api/payout_refunds_api_spec.rb +56 -0
  140. data/spec/api/tax_residence_api_spec.rb +108 -0
  141. data/spec/api/transaction_api_spec.rb +11 -11
  142. data/spec/api/transfer_api_spec.rb +21 -21
  143. data/spec/api/transferrefund_api_spec.rb +21 -21
  144. data/spec/api/user_api_spec.rb +58 -41
  145. data/spec/api/virtualibans_api_spec.rb +23 -23
  146. data/spec/api/wallet_api_spec.rb +42 -42
  147. data/spec/models/beneficiary_spec.rb +6 -0
  148. data/spec/models/card_digitalization_spec.rb +0 -12
  149. data/spec/models/card_spec.rb +6 -0
  150. data/spec/models/country_restriction_group_spec.rb +82 -0
  151. data/spec/models/document_spec.rb +6 -0
  152. data/spec/models/inline_response_200_11_cardtransactions_spec.rb +342 -0
  153. data/spec/models/inline_response_200_11_spec.rb +1 -1
  154. data/spec/models/inline_response_200_12_spec.rb +1 -1
  155. data/spec/models/inline_response_200_13_spec.rb +1 -1
  156. data/spec/models/inline_response_200_16_spec.rb +1 -1
  157. data/spec/models/inline_response_200_17_spec.rb +1 -1
  158. data/spec/models/inline_response_200_18_spec.rb +1 -1
  159. data/spec/models/inline_response_200_19_spec.rb +1 -1
  160. data/spec/models/inline_response_200_20_spec.rb +1 -1
  161. data/spec/models/inline_response_200_21_spec.rb +1 -1
  162. data/spec/models/inline_response_200_22_spec.rb +1 -1
  163. data/spec/models/inline_response_200_24_spec.rb +1 -1
  164. data/spec/models/inline_response_200_25_spec.rb +1 -1
  165. data/spec/models/inline_response_200_26_spec.rb +42 -0
  166. data/spec/models/inline_response_200_27_spec.rb +42 -0
  167. data/spec/models/inline_response_200_28_spec.rb +42 -0
  168. data/spec/models/issuer_initiated_digitization_datas_additionnal_data_spec.rb +1 -1
  169. data/spec/models/merchant_id_restriction_group_spec.rb +1 -1
  170. data/spec/models/payout_refund_spec.rb +130 -0
  171. data/spec/models/tax_residence_spec.rb +84 -0
  172. data/spec/models/user_spec.rb +42 -0
  173. data/treezor_api_spec.yaml +1841 -1207
  174. data/treezor_client.gemspec +1 -3
  175. metadata +45 -9
  176. data/spec/models/card_digitalization_details_from_gps_spec.rb +0 -234
  177. data/spec/models/issuer_initiated_digitization_datas_additionnal_data_ecc_public_certificates_spec.rb +0 -54
@@ -18,6 +18,9 @@ module TreezorClient
18
18
  # Custom data that could be used by caller to search the instance.
19
19
  attr_accessor :tag
20
20
 
21
+ # Should be named beneficiaryId to conform to the API's naming convention.
22
+ attr_accessor :id
23
+
21
24
  # Beneficiary's userId
22
25
  attr_accessor :user_id
23
26
 
@@ -55,6 +58,7 @@ module TreezorClient
55
58
  def self.attribute_map
56
59
  {
57
60
  :'tag' => :'tag',
61
+ :'id' => :'id',
58
62
  :'user_id' => :'userId',
59
63
  :'nick_name' => :'nickName',
60
64
  :'name' => :'name',
@@ -73,6 +77,7 @@ module TreezorClient
73
77
  def self.swagger_types
74
78
  {
75
79
  :'tag' => :'String',
80
+ :'id' => :'Integer',
76
81
  :'user_id' => :'Integer',
77
82
  :'nick_name' => :'String',
78
83
  :'name' => :'String',
@@ -99,6 +104,10 @@ module TreezorClient
99
104
  self.tag = attributes[:'tag']
100
105
  end
101
106
 
107
+ if attributes.has_key?(:'id')
108
+ self.id = attributes[:'id']
109
+ end
110
+
102
111
  if attributes.has_key?(:'userId')
103
112
  self.user_id = attributes[:'userId']
104
113
  end
@@ -172,6 +181,7 @@ module TreezorClient
172
181
  return true if self.equal?(o)
173
182
  self.class == o.class &&
174
183
  tag == o.tag &&
184
+ id == o.id &&
175
185
  user_id == o.user_id &&
176
186
  nick_name == o.nick_name &&
177
187
  name == o.name &&
@@ -194,7 +204,7 @@ module TreezorClient
194
204
  # Calculates hash code according to all attributes.
195
205
  # @return [Fixnum] Hash code
196
206
  def hash
197
- [tag, user_id, nick_name, name, address, iban, bic, sepa_creditor_identifier, sdd_b2b_whitelist, sdd_core_blacklist, usable_for_sct, sdd_core_known_unique_mandate_reference].hash
207
+ [tag, id, user_id, nick_name, name, address, iban, bic, sepa_creditor_identifier, sdd_b2b_whitelist, sdd_core_blacklist, usable_for_sct, sdd_core_known_unique_mandate_reference].hash
198
208
  end
199
209
 
200
210
  # Builds the object from hash
@@ -307,9 +307,9 @@ module TreezorClient
307
307
  :'total_payment_day' => :'Integer',
308
308
  :'total_payment_all' => :'Integer',
309
309
  :'created_by' => :'Integer',
310
- :'created_date' => :'Integer',
310
+ :'created_date' => :'String',
311
311
  :'modified_by' => :'Integer',
312
- :'modified_date' => :'Integer',
312
+ :'modified_date' => :'String',
313
313
  :'total_rows' => :'Integer'
314
314
  }
315
315
  end
@@ -17,12 +17,9 @@ module TreezorClient
17
17
  class CardDigitalization
18
18
  attr_accessor :id
19
19
 
20
- attr_accessor :external_id
21
-
22
20
  attr_accessor :card_id
23
21
 
24
- attr_accessor :details_from_gps
25
-
22
+ # | Status | Description | | ---- | ----------- | | A | Active | | N | Not tokenized | | S | Suspended | | X | Deactivated (Final status, cannot be changed)|
26
23
  attr_accessor :status
27
24
 
28
25
  attr_accessor :created_date
@@ -34,9 +31,7 @@ module TreezorClient
34
31
  def self.attribute_map
35
32
  {
36
33
  :'id' => :'id',
37
- :'external_id' => :'externalId',
38
34
  :'card_id' => :'cardId',
39
- :'details_from_gps' => :'detailsFromGPS',
40
35
  :'status' => :'status',
41
36
  :'created_date' => :'createdDate',
42
37
  :'modified_date' => :'modifiedDate'
@@ -47,10 +42,8 @@ module TreezorClient
47
42
  def self.swagger_types
48
43
  {
49
44
  :'id' => :'Integer',
50
- :'external_id' => :'Integer',
51
45
  :'card_id' => :'String',
52
- :'details_from_gps' => :'CardDigitalizationDetailsFromGPS',
53
- :'status' => :'Integer',
46
+ :'status' => :'String',
54
47
  :'created_date' => :'String',
55
48
  :'modified_date' => :'String'
56
49
  }
@@ -68,18 +61,10 @@ module TreezorClient
68
61
  self.id = attributes[:'id']
69
62
  end
70
63
 
71
- if attributes.has_key?(:'externalId')
72
- self.external_id = attributes[:'externalId']
73
- end
74
-
75
64
  if attributes.has_key?(:'cardId')
76
65
  self.card_id = attributes[:'cardId']
77
66
  end
78
67
 
79
- if attributes.has_key?(:'detailsFromGPS')
80
- self.details_from_gps = attributes[:'detailsFromGPS']
81
- end
82
-
83
68
  if attributes.has_key?(:'status')
84
69
  self.status = attributes[:'status']
85
70
  end
@@ -113,9 +98,7 @@ module TreezorClient
113
98
  return true if self.equal?(o)
114
99
  self.class == o.class &&
115
100
  id == o.id &&
116
- external_id == o.external_id &&
117
101
  card_id == o.card_id &&
118
- details_from_gps == o.details_from_gps &&
119
102
  status == o.status &&
120
103
  created_date == o.created_date &&
121
104
  modified_date == o.modified_date
@@ -130,7 +113,7 @@ module TreezorClient
130
113
  # Calculates hash code according to all attributes.
131
114
  # @return [Fixnum] Hash code
132
115
  def hash
133
- [id, external_id, card_id, details_from_gps, status, created_date, modified_date].hash
116
+ [id, card_id, status, created_date, modified_date].hash
134
117
  end
135
118
 
136
119
  # Builds the object from hash
@@ -0,0 +1,284 @@
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 CountryRestrictionGroup
18
+ # Country Group's id
19
+ attr_accessor :id
20
+
21
+ # Country Group's name
22
+ attr_accessor :name
23
+
24
+ # determines whether it will be a black or a white list
25
+ attr_accessor :is_whitelist
26
+
27
+ # Array of countries
28
+ attr_accessor :countries
29
+
30
+ # status of the country group
31
+ attr_accessor :status
32
+
33
+ # Date YYYY-MM-DD HH:MM:SS
34
+ attr_accessor :start_date
35
+
36
+ # Date YYYY-MM-DD HH:MM:SS
37
+ attr_accessor :created_date
38
+
39
+ class EnumAttributeValidator
40
+ attr_reader :datatype
41
+ attr_reader :allowable_values
42
+
43
+ def initialize(datatype, allowable_values)
44
+ @allowable_values = allowable_values.map do |value|
45
+ case datatype.to_s
46
+ when /Integer/i
47
+ value.to_i
48
+ when /Float/i
49
+ value.to_f
50
+ else
51
+ value
52
+ end
53
+ end
54
+ end
55
+
56
+ def valid?(value)
57
+ !value || allowable_values.include?(value)
58
+ end
59
+ end
60
+
61
+ # Attribute mapping from ruby-style variable name to JSON key.
62
+ def self.attribute_map
63
+ {
64
+ :'id' => :'id',
65
+ :'name' => :'name',
66
+ :'is_whitelist' => :'isWhitelist',
67
+ :'countries' => :'countries',
68
+ :'status' => :'status',
69
+ :'start_date' => :'startDate',
70
+ :'created_date' => :'createdDate'
71
+ }
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.swagger_types
76
+ {
77
+ :'id' => :'Integer',
78
+ :'name' => :'String',
79
+ :'is_whitelist' => :'BOOLEAN',
80
+ :'countries' => :'Array<String>',
81
+ :'status' => :'String',
82
+ :'start_date' => :'String',
83
+ :'created_date' => :'String'
84
+ }
85
+ end
86
+
87
+ # Initializes the object
88
+ # @param [Hash] attributes Model attributes in the form of hash
89
+ def initialize(attributes = {})
90
+ return unless attributes.is_a?(Hash)
91
+
92
+ # convert string to symbol for hash key
93
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
94
+
95
+ if attributes.has_key?(:'id')
96
+ self.id = attributes[:'id']
97
+ end
98
+
99
+ if attributes.has_key?(:'name')
100
+ self.name = attributes[:'name']
101
+ end
102
+
103
+ if attributes.has_key?(:'isWhitelist')
104
+ self.is_whitelist = attributes[:'isWhitelist']
105
+ end
106
+
107
+ if attributes.has_key?(:'countries')
108
+ if (value = attributes[:'countries']).is_a?(Array)
109
+ self.countries = value
110
+ end
111
+ end
112
+
113
+ if attributes.has_key?(:'status')
114
+ self.status = attributes[:'status']
115
+ end
116
+
117
+ if attributes.has_key?(:'startDate')
118
+ self.start_date = attributes[:'startDate']
119
+ end
120
+
121
+ if attributes.has_key?(:'createdDate')
122
+ self.created_date = attributes[:'createdDate']
123
+ end
124
+
125
+ end
126
+
127
+ # Show invalid properties with the reasons. Usually used together with valid?
128
+ # @return Array for valid properties with the reasons
129
+ def list_invalid_properties
130
+ invalid_properties = Array.new
131
+ return invalid_properties
132
+ end
133
+
134
+ # Check to see if the all the properties in the model are valid
135
+ # @return true if the model is valid
136
+ def valid?
137
+ status_validator = EnumAttributeValidator.new('String', ["PENDING", "CANCELED", "VALIDATED"])
138
+ return false unless status_validator.valid?(@status)
139
+ return true
140
+ end
141
+
142
+ # Custom attribute writer method checking allowed values (enum).
143
+ # @param [Object] status Object to be assigned
144
+ def status=(status)
145
+ validator = EnumAttributeValidator.new('String', ["PENDING", "CANCELED", "VALIDATED"])
146
+ unless validator.valid?(status)
147
+ fail ArgumentError, "invalid value for 'status', must be one of #{validator.allowable_values}."
148
+ end
149
+ @status = status
150
+ end
151
+
152
+ # Checks equality by comparing each attribute.
153
+ # @param [Object] Object to be compared
154
+ def ==(o)
155
+ return true if self.equal?(o)
156
+ self.class == o.class &&
157
+ id == o.id &&
158
+ name == o.name &&
159
+ is_whitelist == o.is_whitelist &&
160
+ countries == o.countries &&
161
+ status == o.status &&
162
+ start_date == o.start_date &&
163
+ created_date == o.created_date
164
+ end
165
+
166
+ # @see the `==` method
167
+ # @param [Object] Object to be compared
168
+ def eql?(o)
169
+ self == o
170
+ end
171
+
172
+ # Calculates hash code according to all attributes.
173
+ # @return [Fixnum] Hash code
174
+ def hash
175
+ [id, name, is_whitelist, countries, status, start_date, created_date].hash
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+ self.class.swagger_types.each_pair do |key, type|
184
+ if type =~ /\AArray<(.*)>/i
185
+ # check to ensure the input is an array given that the the attribute
186
+ # is documented as an array but the input is not
187
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
188
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
189
+ end
190
+ elsif !attributes[self.class.attribute_map[key]].nil?
191
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
192
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
193
+ end
194
+
195
+ self
196
+ end
197
+
198
+ # Deserializes the data based on type
199
+ # @param string type Data type
200
+ # @param string value Value to be deserialized
201
+ # @return [Object] Deserialized data
202
+ def _deserialize(type, value)
203
+ case type.to_sym
204
+ when :DateTime
205
+ DateTime.parse(value)
206
+ when :Date
207
+ Date.parse(value)
208
+ when :String
209
+ value.to_s
210
+ when :Integer
211
+ value.to_i
212
+ when :Float
213
+ value.to_f
214
+ when :BOOLEAN
215
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
216
+ true
217
+ else
218
+ false
219
+ end
220
+ when :Object
221
+ # generic object (usually a Hash), return directly
222
+ value
223
+ when /\AArray<(?<inner_type>.+)>\z/
224
+ inner_type = Regexp.last_match[:inner_type]
225
+ value.map { |v| _deserialize(inner_type, v) }
226
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
227
+ k_type = Regexp.last_match[:k_type]
228
+ v_type = Regexp.last_match[:v_type]
229
+ {}.tap do |hash|
230
+ value.each do |k, v|
231
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
232
+ end
233
+ end
234
+ else # model
235
+ temp_model = TreezorClient.const_get(type).new
236
+ temp_model.build_from_hash(value)
237
+ end
238
+ end
239
+
240
+ # Returns the string representation of the object
241
+ # @return [String] String presentation of the object
242
+ def to_s
243
+ to_hash.to_s
244
+ end
245
+
246
+ # to_body is an alias to to_hash (backward compatibility)
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_body
249
+ to_hash
250
+ end
251
+
252
+ # Returns the object in the form of hash
253
+ # @return [Hash] Returns the object in the form of hash
254
+ def to_hash
255
+ hash = {}
256
+ self.class.attribute_map.each_pair do |attr, param|
257
+ value = self.send(attr)
258
+ next if value.nil?
259
+ hash[param] = _to_hash(value)
260
+ end
261
+ hash
262
+ end
263
+
264
+ # Outputs non-array value in the form of hash
265
+ # For object, use to_hash. Otherwise, just return the value
266
+ # @param [Object] value Any valid value
267
+ # @return [Hash] Returns the value in the form of hash
268
+ def _to_hash(value)
269
+ if value.is_a?(Array)
270
+ value.compact.map{ |v| _to_hash(v) }
271
+ elsif value.is_a?(Hash)
272
+ {}.tap do |hash|
273
+ value.each { |k, v| hash[k] = _to_hash(v) }
274
+ end
275
+ elsif value.respond_to? :to_hash
276
+ value.to_hash
277
+ else
278
+ value
279
+ end
280
+ end
281
+
282
+ end
283
+
284
+ end
@@ -25,6 +25,8 @@ module TreezorClient
25
25
 
26
26
  attr_accessor :document_type
27
27
 
28
+ attr_accessor :residence_id
29
+
28
30
  attr_accessor :client_id
29
31
 
30
32
  attr_accessor :user_id
@@ -77,6 +79,7 @@ module TreezorClient
77
79
  :'document_status' => :'documentStatus',
78
80
  :'document_type_id' => :'documentTypeId',
79
81
  :'document_type' => :'documentType',
82
+ :'residence_id' => :'residenceId',
80
83
  :'client_id' => :'clientId',
81
84
  :'user_id' => :'userId',
82
85
  :'user_lastname' => :'userLastname',
@@ -98,6 +101,7 @@ module TreezorClient
98
101
  :'document_status' => :'String',
99
102
  :'document_type_id' => :'Integer',
100
103
  :'document_type' => :'String',
104
+ :'residence_id' => :'Integer',
101
105
  :'client_id' => :'Integer',
102
106
  :'user_id' => :'Integer',
103
107
  :'user_lastname' => :'String',
@@ -139,6 +143,10 @@ module TreezorClient
139
143
  self.document_type = attributes[:'documentType']
140
144
  end
141
145
 
146
+ if attributes.has_key?(:'residenceId')
147
+ self.residence_id = attributes[:'residenceId']
148
+ end
149
+
142
150
  if attributes.has_key?(:'clientId')
143
151
  self.client_id = attributes[:'clientId']
144
152
  end
@@ -216,6 +224,7 @@ module TreezorClient
216
224
  document_status == o.document_status &&
217
225
  document_type_id == o.document_type_id &&
218
226
  document_type == o.document_type &&
227
+ residence_id == o.residence_id &&
219
228
  client_id == o.client_id &&
220
229
  user_id == o.user_id &&
221
230
  user_lastname == o.user_lastname &&
@@ -237,7 +246,7 @@ module TreezorClient
237
246
  # Calculates hash code according to all attributes.
238
247
  # @return [Fixnum] Hash code
239
248
  def hash
240
- [document_id, document_tag, document_status, document_type_id, document_type, client_id, user_id, user_lastname, user_firstname, file_name, temporary_url, temporary_url_thumb, created_date, modified_date, total_rows].hash
249
+ [document_id, document_tag, document_status, document_type_id, document_type, residence_id, client_id, user_id, user_lastname, user_firstname, file_name, temporary_url, temporary_url_thumb, created_date, modified_date, total_rows].hash
241
250
  end
242
251
 
243
252
  # Builds the object from hash
@@ -182,9 +182,9 @@ module TreezorClient
182
182
  # Attribute type mapping.
183
183
  def self.swagger_types
184
184
  {
185
- :'cardtransaction_id' => :'String',
186
- :'card_id' => :'String',
187
- :'wallet_id' => :'String',
185
+ :'cardtransaction_id' => :'Integer',
186
+ :'card_id' => :'Integer',
187
+ :'wallet_id' => :'Integer',
188
188
  :'wallet_currency' => :'String',
189
189
  :'merchant_id' => :'String',
190
190
  :'merchant_name' => :'String',
@@ -15,20 +15,20 @@ require 'date'
15
15
  module TreezorClient
16
16
 
17
17
  class InlineResponse20011
18
- attr_accessor :documents
18
+ attr_accessor :cardtransactions
19
19
 
20
20
 
21
21
  # Attribute mapping from ruby-style variable name to JSON key.
22
22
  def self.attribute_map
23
23
  {
24
- :'documents' => :'documents'
24
+ :'cardtransactions' => :'cardtransactions'
25
25
  }
26
26
  end
27
27
 
28
28
  # Attribute type mapping.
29
29
  def self.swagger_types
30
30
  {
31
- :'documents' => :'Array<Document>'
31
+ :'cardtransactions' => :'Array<InlineResponse20011Cardtransactions>'
32
32
  }
33
33
  end
34
34
 
@@ -40,9 +40,9 @@ module TreezorClient
40
40
  # convert string to symbol for hash key
41
41
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
42
42
 
43
- if attributes.has_key?(:'documents')
44
- if (value = attributes[:'documents']).is_a?(Array)
45
- self.documents = value
43
+ if attributes.has_key?(:'cardtransactions')
44
+ if (value = attributes[:'cardtransactions']).is_a?(Array)
45
+ self.cardtransactions = value
46
46
  end
47
47
  end
48
48
 
@@ -66,7 +66,7 @@ module TreezorClient
66
66
  def ==(o)
67
67
  return true if self.equal?(o)
68
68
  self.class == o.class &&
69
- documents == o.documents
69
+ cardtransactions == o.cardtransactions
70
70
  end
71
71
 
72
72
  # @see the `==` method
@@ -78,7 +78,7 @@ module TreezorClient
78
78
  # Calculates hash code according to all attributes.
79
79
  # @return [Fixnum] Hash code
80
80
  def hash
81
- [documents].hash
81
+ [cardtransactions].hash
82
82
  end
83
83
 
84
84
  # Builds the object from hash