wallee-ruby-sdk 2.2.3 → 2.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +1 -1
  4. data/lib/wallee-ruby-sdk.rb +17 -5
  5. data/lib/wallee-ruby-sdk/api/payment_terminal_till_service_api.rb +99 -0
  6. data/lib/wallee-ruby-sdk/api/shopify_subscription_service_api.rb +124 -0
  7. data/lib/wallee-ruby-sdk/api/shopify_transaction_service_api.rb +213 -0
  8. data/lib/wallee-ruby-sdk/api/subscriber_service_api.rb +3 -3
  9. data/lib/wallee-ruby-sdk/api/subscription_service_api.rb +67 -0
  10. data/lib/wallee-ruby-sdk/api/token_service_api.rb +126 -0
  11. data/lib/wallee-ruby-sdk/api_client.rb +5 -3
  12. data/lib/wallee-ruby-sdk/configuration.rb +2 -2
  13. data/lib/wallee-ruby-sdk/models/abstract_account_update.rb +11 -1
  14. data/lib/wallee-ruby-sdk/models/{abstract_shopify_subscription_product_active.rb → abstract_shopify_subscription_product_update.rb} +2 -12
  15. data/lib/wallee-ruby-sdk/models/abstract_space_update.rb +11 -1
  16. data/lib/wallee-ruby-sdk/models/abstract_transaction_pending.rb +59 -1
  17. data/lib/wallee-ruby-sdk/models/abstract_webhook_url_update.rb +24 -0
  18. data/lib/wallee-ruby-sdk/models/account.rb +31 -1
  19. data/lib/wallee-ruby-sdk/models/account_create.rb +11 -1
  20. data/lib/wallee-ruby-sdk/models/account_update.rb +11 -1
  21. data/lib/wallee-ruby-sdk/models/charge_attempt.rb +11 -1
  22. data/lib/wallee-ruby-sdk/models/payment_connector_configuration.rb +13 -1
  23. data/lib/wallee-ruby-sdk/models/sales_channel.rb +34 -4
  24. data/lib/wallee-ruby-sdk/models/shopify_additional_line_item_data.rb +35 -0
  25. data/lib/wallee-ruby-sdk/models/shopify_integration.rb +73 -31
  26. data/lib/wallee-ruby-sdk/models/shopify_integration_payment_app_version.rb +34 -0
  27. data/lib/wallee-ruby-sdk/models/{shopify_integration_app_version.rb → shopify_integration_subscription_app_version.rb} +3 -3
  28. data/lib/wallee-ruby-sdk/models/shopify_subscriber_creation.rb +216 -0
  29. data/lib/wallee-ruby-sdk/models/shopify_subscription.rb +51 -7
  30. data/lib/wallee-ruby-sdk/models/shopify_subscription_address.rb +0 -60
  31. data/lib/wallee-ruby-sdk/models/shopify_subscription_address_create.rb +546 -0
  32. data/lib/wallee-ruby-sdk/models/shopify_subscription_creation_request.rb +353 -0
  33. data/lib/wallee-ruby-sdk/models/shopify_subscription_model_billing_configuration.rb +261 -0
  34. data/lib/wallee-ruby-sdk/models/{shopify_subscription_edit_model_item.rb → shopify_subscription_model_item.rb} +2 -2
  35. data/lib/wallee-ruby-sdk/models/{shopify_subscription_edit_model_tax_line.rb → shopify_subscription_model_tax_line.rb} +1 -1
  36. data/lib/wallee-ruby-sdk/models/shopify_subscription_product_create.rb +9 -14
  37. data/lib/wallee-ruby-sdk/models/{shopify_subscription_product_active.rb → shopify_subscription_product_update.rb} +2 -12
  38. data/lib/wallee-ruby-sdk/models/shopify_subscription_update_addresses_request.rb +211 -0
  39. data/lib/wallee-ruby-sdk/models/shopify_subscription_update_request.rb +11 -81
  40. data/lib/wallee-ruby-sdk/models/space.rb +31 -1
  41. data/lib/wallee-ruby-sdk/models/space_create.rb +11 -1
  42. data/lib/wallee-ruby-sdk/models/space_update.rb +11 -1
  43. data/lib/wallee-ruby-sdk/models/subscription.rb +11 -1
  44. data/lib/wallee-ruby-sdk/models/subscription_charge.rb +48 -0
  45. data/lib/wallee-ruby-sdk/models/subscription_charge_create.rb +48 -0
  46. data/lib/wallee-ruby-sdk/models/subscription_create_request.rb +1 -1
  47. data/lib/wallee-ruby-sdk/models/subscription_product_version.rb +11 -1
  48. data/lib/wallee-ruby-sdk/models/subscription_product_version_pending.rb +14 -4
  49. data/lib/wallee-ruby-sdk/models/subscription_update_request.rb +206 -0
  50. data/lib/wallee-ruby-sdk/models/tax_calculation.rb +35 -0
  51. data/lib/wallee-ruby-sdk/models/transaction.rb +69 -1
  52. data/lib/wallee-ruby-sdk/models/transaction_completion.rb +26 -1
  53. data/lib/wallee-ruby-sdk/models/transaction_completion_behavior.rb +36 -0
  54. data/lib/wallee-ruby-sdk/models/transaction_completion_request.rb +26 -1
  55. data/lib/wallee-ruby-sdk/models/transaction_create.rb +59 -1
  56. data/lib/wallee-ruby-sdk/models/transaction_pending.rb +59 -1
  57. data/lib/wallee-ruby-sdk/models/webhook_url.rb +24 -0
  58. data/lib/wallee-ruby-sdk/models/webhook_url_create.rb +24 -0
  59. data/lib/wallee-ruby-sdk/models/webhook_url_update.rb +24 -0
  60. data/lib/wallee-ruby-sdk/version.rb +1 -1
  61. data/wallee-ruby-sdk.gemspec +3 -2
  62. metadata +45 -14
@@ -26,11 +26,17 @@ module Wallee
26
26
  #
27
27
  attr_accessor :created_on
28
28
 
29
+ # The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity.
30
+ attr_accessor :external_id
31
+
29
32
  # The ID is the primary key of the entity. The ID identifies the entity uniquely.
30
33
  attr_accessor :id
31
34
 
32
35
  #
33
- attr_accessor :initial_transaction
36
+ attr_accessor :initial_payment_transaction
37
+
38
+ #
39
+ attr_accessor :initial_shopify_transaction
34
40
 
35
41
  #
36
42
  attr_accessor :language
@@ -67,8 +73,10 @@ module Wallee
67
73
  {
68
74
  :'created_by' => :'createdBy',
69
75
  :'created_on' => :'createdOn',
76
+ :'external_id' => :'externalId',
70
77
  :'id' => :'id',
71
- :'initial_transaction' => :'initialTransaction',
78
+ :'initial_payment_transaction' => :'initialPaymentTransaction',
79
+ :'initial_shopify_transaction' => :'initialShopifyTransaction',
72
80
  :'language' => :'language',
73
81
  :'linked_space_id' => :'linkedSpaceId',
74
82
  :'order_recurrence_number' => :'orderRecurrenceNumber',
@@ -87,8 +95,10 @@ module Wallee
87
95
  {
88
96
  :'created_by' => :'Integer',
89
97
  :'created_on' => :'DateTime',
98
+ :'external_id' => :'String',
90
99
  :'id' => :'Integer',
91
- :'initial_transaction' => :'Integer',
100
+ :'initial_payment_transaction' => :'Integer',
101
+ :'initial_shopify_transaction' => :'Integer',
92
102
  :'language' => :'String',
93
103
  :'linked_space_id' => :'Integer',
94
104
  :'order_recurrence_number' => :'Integer',
@@ -118,12 +128,20 @@ module Wallee
118
128
  self.created_on = attributes[:'createdOn']
119
129
  end
120
130
 
131
+ if attributes.has_key?(:'externalId')
132
+ self.external_id = attributes[:'externalId']
133
+ end
134
+
121
135
  if attributes.has_key?(:'id')
122
136
  self.id = attributes[:'id']
123
137
  end
124
138
 
125
- if attributes.has_key?(:'initialTransaction')
126
- self.initial_transaction = attributes[:'initialTransaction']
139
+ if attributes.has_key?(:'initialPaymentTransaction')
140
+ self.initial_payment_transaction = attributes[:'initialPaymentTransaction']
141
+ end
142
+
143
+ if attributes.has_key?(:'initialShopifyTransaction')
144
+ self.initial_shopify_transaction = attributes[:'initialShopifyTransaction']
127
145
  end
128
146
 
129
147
  if attributes.has_key?(:'language')
@@ -171,15 +189,39 @@ module Wallee
171
189
  # @return Array for valid properties with the reasons
172
190
  def list_invalid_properties
173
191
  invalid_properties = Array.new
192
+ if !@external_id.nil? && @external_id.to_s.length > 100
193
+ invalid_properties.push('invalid value for "external_id", the character length must be smaller than or equal to 100.')
194
+ end
195
+
196
+ if !@external_id.nil? && @external_id.to_s.length < 1
197
+ invalid_properties.push('invalid value for "external_id", the character length must be great than or equal to 1.')
198
+ end
199
+
174
200
  invalid_properties
175
201
  end
176
202
 
177
203
  # Check to see if the all the properties in the model are valid
178
204
  # @return true if the model is valid
179
205
  def valid?
206
+ return false if !@external_id.nil? && @external_id.to_s.length > 100
207
+ return false if !@external_id.nil? && @external_id.to_s.length < 1
180
208
  true
181
209
  end
182
210
 
211
+ # Custom attribute writer method with validation
212
+ # @param [Object] external_id Value to be assigned
213
+ def external_id=(external_id)
214
+ if !external_id.nil? && external_id.to_s.length > 100
215
+ fail ArgumentError, 'invalid value for "external_id", the character length must be smaller than or equal to 100.'
216
+ end
217
+
218
+ if !external_id.nil? && external_id.to_s.length < 1
219
+ fail ArgumentError, 'invalid value for "external_id", the character length must be great than or equal to 1.'
220
+ end
221
+
222
+ @external_id = external_id
223
+ end
224
+
183
225
  # Checks equality by comparing each attribute.
184
226
  # @param [Object] Object to be compared
185
227
  def ==(o)
@@ -187,8 +229,10 @@ module Wallee
187
229
  self.class == o.class &&
188
230
  created_by == o.created_by &&
189
231
  created_on == o.created_on &&
232
+ external_id == o.external_id &&
190
233
  id == o.id &&
191
- initial_transaction == o.initial_transaction &&
234
+ initial_payment_transaction == o.initial_payment_transaction &&
235
+ initial_shopify_transaction == o.initial_shopify_transaction &&
192
236
  language == o.language &&
193
237
  linked_space_id == o.linked_space_id &&
194
238
  order_recurrence_number == o.order_recurrence_number &&
@@ -210,7 +254,7 @@ module Wallee
210
254
  # Calculates hash code according to all attributes.
211
255
  # @return [Fixnum] Hash code
212
256
  def hash
213
- [created_by, created_on, id, initial_transaction, language, linked_space_id, order_recurrence_number, shop, state, subscriber, terminated_by, terminated_on, termination_request_date, version].hash
257
+ [created_by, created_on, external_id, id, initial_payment_transaction, initial_shopify_transaction, language, linked_space_id, order_recurrence_number, shop, state, subscriber, terminated_by, terminated_on, termination_request_date, version].hash
214
258
  end
215
259
 
216
260
  # Builds the object from hash
@@ -225,10 +225,6 @@ module Wallee
225
225
  # @return Array for valid properties with the reasons
226
226
  def list_invalid_properties
227
227
  invalid_properties = Array.new
228
- if !@city.nil? && @city.to_s.length > 100
229
- invalid_properties.push('invalid value for "city", the character length must be smaller than or equal to 100.')
230
- end
231
-
232
228
  if !@commercial_register_number.nil? && @commercial_register_number.to_s.length > 100
233
229
  invalid_properties.push('invalid value for "commercial_register_number", the character length must be smaller than or equal to 100.')
234
230
  end
@@ -241,10 +237,6 @@ module Wallee
241
237
  invalid_properties.push('invalid value for "email_address", the character length must be smaller than or equal to 254.')
242
238
  end
243
239
 
244
- if !@family_name.nil? && @family_name.to_s.length > 100
245
- invalid_properties.push('invalid value for "family_name", the character length must be smaller than or equal to 100.')
246
- end
247
-
248
240
  if !@given_name.nil? && @given_name.to_s.length > 100
249
241
  invalid_properties.push('invalid value for "given_name", the character length must be smaller than or equal to 100.')
250
242
  end
@@ -261,10 +253,6 @@ module Wallee
261
253
  invalid_properties.push('invalid value for "phone_number", the character length must be smaller than or equal to 100.')
262
254
  end
263
255
 
264
- if !@postcode.nil? && @postcode.to_s.length > 40
265
- invalid_properties.push('invalid value for "postcode", the character length must be smaller than or equal to 40.')
266
- end
267
-
268
256
  if !@sales_tax_number.nil? && @sales_tax_number.to_s.length > 100
269
257
  invalid_properties.push('invalid value for "sales_tax_number", the character length must be smaller than or equal to 100.')
270
258
  end
@@ -281,44 +269,26 @@ module Wallee
281
269
  invalid_properties.push('invalid value for "sorting_code", the character length must be smaller than or equal to 100.')
282
270
  end
283
271
 
284
- if !@street.nil? && @street.to_s.length > 300
285
- invalid_properties.push('invalid value for "street", the character length must be smaller than or equal to 300.')
286
- end
287
-
288
272
  invalid_properties
289
273
  end
290
274
 
291
275
  # Check to see if the all the properties in the model are valid
292
276
  # @return true if the model is valid
293
277
  def valid?
294
- return false if !@city.nil? && @city.to_s.length > 100
295
278
  return false if !@commercial_register_number.nil? && @commercial_register_number.to_s.length > 100
296
279
  return false if !@dependent_locality.nil? && @dependent_locality.to_s.length > 100
297
280
  return false if !@email_address.nil? && @email_address.to_s.length > 254
298
- return false if !@family_name.nil? && @family_name.to_s.length > 100
299
281
  return false if !@given_name.nil? && @given_name.to_s.length > 100
300
282
  return false if !@mobile_phone_number.nil? && @mobile_phone_number.to_s.length > 100
301
283
  return false if !@organization_name.nil? && @organization_name.to_s.length > 100
302
284
  return false if !@phone_number.nil? && @phone_number.to_s.length > 100
303
- return false if !@postcode.nil? && @postcode.to_s.length > 40
304
285
  return false if !@sales_tax_number.nil? && @sales_tax_number.to_s.length > 100
305
286
  return false if !@salutation.nil? && @salutation.to_s.length > 20
306
287
  return false if !@social_security_number.nil? && @social_security_number.to_s.length > 100
307
288
  return false if !@sorting_code.nil? && @sorting_code.to_s.length > 100
308
- return false if !@street.nil? && @street.to_s.length > 300
309
289
  true
310
290
  end
311
291
 
312
- # Custom attribute writer method with validation
313
- # @param [Object] city Value to be assigned
314
- def city=(city)
315
- if !city.nil? && city.to_s.length > 100
316
- fail ArgumentError, 'invalid value for "city", the character length must be smaller than or equal to 100.'
317
- end
318
-
319
- @city = city
320
- end
321
-
322
292
  # Custom attribute writer method with validation
323
293
  # @param [Object] commercial_register_number Value to be assigned
324
294
  def commercial_register_number=(commercial_register_number)
@@ -349,16 +319,6 @@ module Wallee
349
319
  @email_address = email_address
350
320
  end
351
321
 
352
- # Custom attribute writer method with validation
353
- # @param [Object] family_name Value to be assigned
354
- def family_name=(family_name)
355
- if !family_name.nil? && family_name.to_s.length > 100
356
- fail ArgumentError, 'invalid value for "family_name", the character length must be smaller than or equal to 100.'
357
- end
358
-
359
- @family_name = family_name
360
- end
361
-
362
322
  # Custom attribute writer method with validation
363
323
  # @param [Object] given_name Value to be assigned
364
324
  def given_name=(given_name)
@@ -399,16 +359,6 @@ module Wallee
399
359
  @phone_number = phone_number
400
360
  end
401
361
 
402
- # Custom attribute writer method with validation
403
- # @param [Object] postcode Value to be assigned
404
- def postcode=(postcode)
405
- if !postcode.nil? && postcode.to_s.length > 40
406
- fail ArgumentError, 'invalid value for "postcode", the character length must be smaller than or equal to 40.'
407
- end
408
-
409
- @postcode = postcode
410
- end
411
-
412
362
  # Custom attribute writer method with validation
413
363
  # @param [Object] sales_tax_number Value to be assigned
414
364
  def sales_tax_number=(sales_tax_number)
@@ -449,16 +399,6 @@ module Wallee
449
399
  @sorting_code = sorting_code
450
400
  end
451
401
 
452
- # Custom attribute writer method with validation
453
- # @param [Object] street Value to be assigned
454
- def street=(street)
455
- if !street.nil? && street.to_s.length > 300
456
- fail ArgumentError, 'invalid value for "street", the character length must be smaller than or equal to 300.'
457
- end
458
-
459
- @street = street
460
- end
461
-
462
402
  # Checks equality by comparing each attribute.
463
403
  # @param [Object] Object to be compared
464
404
  def ==(o)
@@ -0,0 +1,546 @@
1
+ =begin
2
+ The wallee API allows an easy interaction with the wallee web service.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ =end
17
+
18
+ require 'date'
19
+
20
+ module Wallee
21
+ #
22
+ class ShopifySubscriptionAddressCreate
23
+ #
24
+ attr_accessor :city
25
+
26
+ #
27
+ attr_accessor :commercial_register_number
28
+
29
+ #
30
+ attr_accessor :country
31
+
32
+ #
33
+ attr_accessor :date_of_birth
34
+
35
+ #
36
+ attr_accessor :dependent_locality
37
+
38
+ #
39
+ attr_accessor :email_address
40
+
41
+ #
42
+ attr_accessor :family_name
43
+
44
+ #
45
+ attr_accessor :gender
46
+
47
+ #
48
+ attr_accessor :given_name
49
+
50
+ #
51
+ attr_accessor :legal_organization_form
52
+
53
+ #
54
+ attr_accessor :mobile_phone_number
55
+
56
+ #
57
+ attr_accessor :organization_name
58
+
59
+ #
60
+ attr_accessor :phone_number
61
+
62
+ #
63
+ attr_accessor :postal_state
64
+
65
+ #
66
+ attr_accessor :postcode
67
+
68
+ #
69
+ attr_accessor :sales_tax_number
70
+
71
+ #
72
+ attr_accessor :salutation
73
+
74
+ #
75
+ attr_accessor :social_security_number
76
+
77
+ # The sorting code identifies the post office at which the post box is located in.
78
+ attr_accessor :sorting_code
79
+
80
+ #
81
+ attr_accessor :street
82
+
83
+ # Attribute mapping from ruby-style variable name to JSON key.
84
+ def self.attribute_map
85
+ {
86
+ :'city' => :'city',
87
+ :'commercial_register_number' => :'commercialRegisterNumber',
88
+ :'country' => :'country',
89
+ :'date_of_birth' => :'dateOfBirth',
90
+ :'dependent_locality' => :'dependentLocality',
91
+ :'email_address' => :'emailAddress',
92
+ :'family_name' => :'familyName',
93
+ :'gender' => :'gender',
94
+ :'given_name' => :'givenName',
95
+ :'legal_organization_form' => :'legalOrganizationForm',
96
+ :'mobile_phone_number' => :'mobilePhoneNumber',
97
+ :'organization_name' => :'organizationName',
98
+ :'phone_number' => :'phoneNumber',
99
+ :'postal_state' => :'postalState',
100
+ :'postcode' => :'postcode',
101
+ :'sales_tax_number' => :'salesTaxNumber',
102
+ :'salutation' => :'salutation',
103
+ :'social_security_number' => :'socialSecurityNumber',
104
+ :'sorting_code' => :'sortingCode',
105
+ :'street' => :'street'
106
+ }
107
+ end
108
+
109
+ # Attribute type mapping.
110
+ def self.swagger_types
111
+ {
112
+ :'city' => :'String',
113
+ :'commercial_register_number' => :'String',
114
+ :'country' => :'String',
115
+ :'date_of_birth' => :'Date',
116
+ :'dependent_locality' => :'String',
117
+ :'email_address' => :'String',
118
+ :'family_name' => :'String',
119
+ :'gender' => :'Gender',
120
+ :'given_name' => :'String',
121
+ :'legal_organization_form' => :'Integer',
122
+ :'mobile_phone_number' => :'String',
123
+ :'organization_name' => :'String',
124
+ :'phone_number' => :'String',
125
+ :'postal_state' => :'String',
126
+ :'postcode' => :'String',
127
+ :'sales_tax_number' => :'String',
128
+ :'salutation' => :'String',
129
+ :'social_security_number' => :'String',
130
+ :'sorting_code' => :'String',
131
+ :'street' => :'String'
132
+ }
133
+ end
134
+
135
+ # Initializes the object
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ def initialize(attributes = {})
138
+ return unless attributes.is_a?(Hash)
139
+
140
+ # convert string to symbol for hash key
141
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
142
+
143
+ if attributes.has_key?(:'city')
144
+ self.city = attributes[:'city']
145
+ end
146
+
147
+ if attributes.has_key?(:'commercialRegisterNumber')
148
+ self.commercial_register_number = attributes[:'commercialRegisterNumber']
149
+ end
150
+
151
+ if attributes.has_key?(:'country')
152
+ self.country = attributes[:'country']
153
+ end
154
+
155
+ if attributes.has_key?(:'dateOfBirth')
156
+ self.date_of_birth = attributes[:'dateOfBirth']
157
+ end
158
+
159
+ if attributes.has_key?(:'dependentLocality')
160
+ self.dependent_locality = attributes[:'dependentLocality']
161
+ end
162
+
163
+ if attributes.has_key?(:'emailAddress')
164
+ self.email_address = attributes[:'emailAddress']
165
+ end
166
+
167
+ if attributes.has_key?(:'familyName')
168
+ self.family_name = attributes[:'familyName']
169
+ end
170
+
171
+ if attributes.has_key?(:'gender')
172
+ self.gender = attributes[:'gender']
173
+ end
174
+
175
+ if attributes.has_key?(:'givenName')
176
+ self.given_name = attributes[:'givenName']
177
+ end
178
+
179
+ if attributes.has_key?(:'legalOrganizationForm')
180
+ self.legal_organization_form = attributes[:'legalOrganizationForm']
181
+ end
182
+
183
+ if attributes.has_key?(:'mobilePhoneNumber')
184
+ self.mobile_phone_number = attributes[:'mobilePhoneNumber']
185
+ end
186
+
187
+ if attributes.has_key?(:'organizationName')
188
+ self.organization_name = attributes[:'organizationName']
189
+ end
190
+
191
+ if attributes.has_key?(:'phoneNumber')
192
+ self.phone_number = attributes[:'phoneNumber']
193
+ end
194
+
195
+ if attributes.has_key?(:'postalState')
196
+ self.postal_state = attributes[:'postalState']
197
+ end
198
+
199
+ if attributes.has_key?(:'postcode')
200
+ self.postcode = attributes[:'postcode']
201
+ end
202
+
203
+ if attributes.has_key?(:'salesTaxNumber')
204
+ self.sales_tax_number = attributes[:'salesTaxNumber']
205
+ end
206
+
207
+ if attributes.has_key?(:'salutation')
208
+ self.salutation = attributes[:'salutation']
209
+ end
210
+
211
+ if attributes.has_key?(:'socialSecurityNumber')
212
+ self.social_security_number = attributes[:'socialSecurityNumber']
213
+ end
214
+
215
+ if attributes.has_key?(:'sortingCode')
216
+ self.sorting_code = attributes[:'sortingCode']
217
+ end
218
+
219
+ if attributes.has_key?(:'street')
220
+ self.street = attributes[:'street']
221
+ end
222
+ end
223
+
224
+ # Show invalid properties with the reasons. Usually used together with valid?
225
+ # @return Array for valid properties with the reasons
226
+ def list_invalid_properties
227
+ invalid_properties = Array.new
228
+ if !@commercial_register_number.nil? && @commercial_register_number.to_s.length > 100
229
+ invalid_properties.push('invalid value for "commercial_register_number", the character length must be smaller than or equal to 100.')
230
+ end
231
+
232
+ if !@dependent_locality.nil? && @dependent_locality.to_s.length > 100
233
+ invalid_properties.push('invalid value for "dependent_locality", the character length must be smaller than or equal to 100.')
234
+ end
235
+
236
+ if !@email_address.nil? && @email_address.to_s.length > 254
237
+ invalid_properties.push('invalid value for "email_address", the character length must be smaller than or equal to 254.')
238
+ end
239
+
240
+ if !@given_name.nil? && @given_name.to_s.length > 100
241
+ invalid_properties.push('invalid value for "given_name", the character length must be smaller than or equal to 100.')
242
+ end
243
+
244
+ if !@mobile_phone_number.nil? && @mobile_phone_number.to_s.length > 100
245
+ invalid_properties.push('invalid value for "mobile_phone_number", the character length must be smaller than or equal to 100.')
246
+ end
247
+
248
+ if !@organization_name.nil? && @organization_name.to_s.length > 100
249
+ invalid_properties.push('invalid value for "organization_name", the character length must be smaller than or equal to 100.')
250
+ end
251
+
252
+ if !@phone_number.nil? && @phone_number.to_s.length > 100
253
+ invalid_properties.push('invalid value for "phone_number", the character length must be smaller than or equal to 100.')
254
+ end
255
+
256
+ if !@sales_tax_number.nil? && @sales_tax_number.to_s.length > 100
257
+ invalid_properties.push('invalid value for "sales_tax_number", the character length must be smaller than or equal to 100.')
258
+ end
259
+
260
+ if !@salutation.nil? && @salutation.to_s.length > 20
261
+ invalid_properties.push('invalid value for "salutation", the character length must be smaller than or equal to 20.')
262
+ end
263
+
264
+ if !@social_security_number.nil? && @social_security_number.to_s.length > 100
265
+ invalid_properties.push('invalid value for "social_security_number", the character length must be smaller than or equal to 100.')
266
+ end
267
+
268
+ if !@sorting_code.nil? && @sorting_code.to_s.length > 100
269
+ invalid_properties.push('invalid value for "sorting_code", the character length must be smaller than or equal to 100.')
270
+ end
271
+
272
+ invalid_properties
273
+ end
274
+
275
+ # Check to see if the all the properties in the model are valid
276
+ # @return true if the model is valid
277
+ def valid?
278
+ return false if !@commercial_register_number.nil? && @commercial_register_number.to_s.length > 100
279
+ return false if !@dependent_locality.nil? && @dependent_locality.to_s.length > 100
280
+ return false if !@email_address.nil? && @email_address.to_s.length > 254
281
+ return false if !@given_name.nil? && @given_name.to_s.length > 100
282
+ return false if !@mobile_phone_number.nil? && @mobile_phone_number.to_s.length > 100
283
+ return false if !@organization_name.nil? && @organization_name.to_s.length > 100
284
+ return false if !@phone_number.nil? && @phone_number.to_s.length > 100
285
+ return false if !@sales_tax_number.nil? && @sales_tax_number.to_s.length > 100
286
+ return false if !@salutation.nil? && @salutation.to_s.length > 20
287
+ return false if !@social_security_number.nil? && @social_security_number.to_s.length > 100
288
+ return false if !@sorting_code.nil? && @sorting_code.to_s.length > 100
289
+ true
290
+ end
291
+
292
+ # Custom attribute writer method with validation
293
+ # @param [Object] commercial_register_number Value to be assigned
294
+ def commercial_register_number=(commercial_register_number)
295
+ if !commercial_register_number.nil? && commercial_register_number.to_s.length > 100
296
+ fail ArgumentError, 'invalid value for "commercial_register_number", the character length must be smaller than or equal to 100.'
297
+ end
298
+
299
+ @commercial_register_number = commercial_register_number
300
+ end
301
+
302
+ # Custom attribute writer method with validation
303
+ # @param [Object] dependent_locality Value to be assigned
304
+ def dependent_locality=(dependent_locality)
305
+ if !dependent_locality.nil? && dependent_locality.to_s.length > 100
306
+ fail ArgumentError, 'invalid value for "dependent_locality", the character length must be smaller than or equal to 100.'
307
+ end
308
+
309
+ @dependent_locality = dependent_locality
310
+ end
311
+
312
+ # Custom attribute writer method with validation
313
+ # @param [Object] email_address Value to be assigned
314
+ def email_address=(email_address)
315
+ if !email_address.nil? && email_address.to_s.length > 254
316
+ fail ArgumentError, 'invalid value for "email_address", the character length must be smaller than or equal to 254.'
317
+ end
318
+
319
+ @email_address = email_address
320
+ end
321
+
322
+ # Custom attribute writer method with validation
323
+ # @param [Object] given_name Value to be assigned
324
+ def given_name=(given_name)
325
+ if !given_name.nil? && given_name.to_s.length > 100
326
+ fail ArgumentError, 'invalid value for "given_name", the character length must be smaller than or equal to 100.'
327
+ end
328
+
329
+ @given_name = given_name
330
+ end
331
+
332
+ # Custom attribute writer method with validation
333
+ # @param [Object] mobile_phone_number Value to be assigned
334
+ def mobile_phone_number=(mobile_phone_number)
335
+ if !mobile_phone_number.nil? && mobile_phone_number.to_s.length > 100
336
+ fail ArgumentError, 'invalid value for "mobile_phone_number", the character length must be smaller than or equal to 100.'
337
+ end
338
+
339
+ @mobile_phone_number = mobile_phone_number
340
+ end
341
+
342
+ # Custom attribute writer method with validation
343
+ # @param [Object] organization_name Value to be assigned
344
+ def organization_name=(organization_name)
345
+ if !organization_name.nil? && organization_name.to_s.length > 100
346
+ fail ArgumentError, 'invalid value for "organization_name", the character length must be smaller than or equal to 100.'
347
+ end
348
+
349
+ @organization_name = organization_name
350
+ end
351
+
352
+ # Custom attribute writer method with validation
353
+ # @param [Object] phone_number Value to be assigned
354
+ def phone_number=(phone_number)
355
+ if !phone_number.nil? && phone_number.to_s.length > 100
356
+ fail ArgumentError, 'invalid value for "phone_number", the character length must be smaller than or equal to 100.'
357
+ end
358
+
359
+ @phone_number = phone_number
360
+ end
361
+
362
+ # Custom attribute writer method with validation
363
+ # @param [Object] sales_tax_number Value to be assigned
364
+ def sales_tax_number=(sales_tax_number)
365
+ if !sales_tax_number.nil? && sales_tax_number.to_s.length > 100
366
+ fail ArgumentError, 'invalid value for "sales_tax_number", the character length must be smaller than or equal to 100.'
367
+ end
368
+
369
+ @sales_tax_number = sales_tax_number
370
+ end
371
+
372
+ # Custom attribute writer method with validation
373
+ # @param [Object] salutation Value to be assigned
374
+ def salutation=(salutation)
375
+ if !salutation.nil? && salutation.to_s.length > 20
376
+ fail ArgumentError, 'invalid value for "salutation", the character length must be smaller than or equal to 20.'
377
+ end
378
+
379
+ @salutation = salutation
380
+ end
381
+
382
+ # Custom attribute writer method with validation
383
+ # @param [Object] social_security_number Value to be assigned
384
+ def social_security_number=(social_security_number)
385
+ if !social_security_number.nil? && social_security_number.to_s.length > 100
386
+ fail ArgumentError, 'invalid value for "social_security_number", the character length must be smaller than or equal to 100.'
387
+ end
388
+
389
+ @social_security_number = social_security_number
390
+ end
391
+
392
+ # Custom attribute writer method with validation
393
+ # @param [Object] sorting_code Value to be assigned
394
+ def sorting_code=(sorting_code)
395
+ if !sorting_code.nil? && sorting_code.to_s.length > 100
396
+ fail ArgumentError, 'invalid value for "sorting_code", the character length must be smaller than or equal to 100.'
397
+ end
398
+
399
+ @sorting_code = sorting_code
400
+ end
401
+
402
+ # Checks equality by comparing each attribute.
403
+ # @param [Object] Object to be compared
404
+ def ==(o)
405
+ return true if self.equal?(o)
406
+ self.class == o.class &&
407
+ city == o.city &&
408
+ commercial_register_number == o.commercial_register_number &&
409
+ country == o.country &&
410
+ date_of_birth == o.date_of_birth &&
411
+ dependent_locality == o.dependent_locality &&
412
+ email_address == o.email_address &&
413
+ family_name == o.family_name &&
414
+ gender == o.gender &&
415
+ given_name == o.given_name &&
416
+ legal_organization_form == o.legal_organization_form &&
417
+ mobile_phone_number == o.mobile_phone_number &&
418
+ organization_name == o.organization_name &&
419
+ phone_number == o.phone_number &&
420
+ postal_state == o.postal_state &&
421
+ postcode == o.postcode &&
422
+ sales_tax_number == o.sales_tax_number &&
423
+ salutation == o.salutation &&
424
+ social_security_number == o.social_security_number &&
425
+ sorting_code == o.sorting_code &&
426
+ street == o.street
427
+ end
428
+
429
+ # @see the `==` method
430
+ # @param [Object] Object to be compared
431
+ def eql?(o)
432
+ self == o
433
+ end
434
+
435
+ # Calculates hash code according to all attributes.
436
+ # @return [Fixnum] Hash code
437
+ def hash
438
+ [city, commercial_register_number, country, date_of_birth, dependent_locality, email_address, family_name, gender, given_name, legal_organization_form, mobile_phone_number, organization_name, phone_number, postal_state, postcode, sales_tax_number, salutation, social_security_number, sorting_code, street].hash
439
+ end
440
+
441
+ # Builds the object from hash
442
+ # @param [Hash] attributes Model attributes in the form of hash
443
+ # @return [Object] Returns the model itself
444
+ def build_from_hash(attributes)
445
+ return nil unless attributes.is_a?(Hash)
446
+ self.class.swagger_types.each_pair do |key, type|
447
+ if type =~ /\AArray<(.*)>/i
448
+ # check to ensure the input is an array given that the attribute
449
+ # is documented as an array but the input is not
450
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
451
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
452
+ end
453
+ elsif !attributes[self.class.attribute_map[key]].nil?
454
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
455
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
456
+ end
457
+
458
+ self
459
+ end
460
+
461
+ # Deserializes the data based on type
462
+ # @param string type Data type
463
+ # @param string value Value to be deserialized
464
+ # @return [Object] Deserialized data
465
+ def _deserialize(type, value)
466
+ case type.to_sym
467
+ when :DateTime
468
+ DateTime.parse(value)
469
+ when :Date
470
+ Date.parse(value)
471
+ when :String
472
+ value.to_s
473
+ when :Integer
474
+ value.to_i
475
+ when :Float
476
+ value.to_f
477
+ when :BOOLEAN
478
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
479
+ true
480
+ else
481
+ false
482
+ end
483
+ when :Object
484
+ # generic object (usually a Hash), return directly
485
+ value
486
+ when /\AArray<(?<inner_type>.+)>\z/
487
+ inner_type = Regexp.last_match[:inner_type]
488
+ value.map { |v| _deserialize(inner_type, v) }
489
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
490
+ k_type = Regexp.last_match[:k_type]
491
+ v_type = Regexp.last_match[:v_type]
492
+ {}.tap do |hash|
493
+ value.each do |k, v|
494
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
495
+ end
496
+ end
497
+ else # model
498
+ temp_model = Wallee.const_get(type).new
499
+ temp_model.build_from_hash(value)
500
+ end
501
+ end
502
+
503
+ # Returns the string representation of the object
504
+ # @return [String] String presentation of the object
505
+ def to_s
506
+ to_hash.to_s
507
+ end
508
+
509
+ # to_body is an alias to to_hash (backward compatibility)
510
+ # @return [Hash] Returns the object in the form of hash
511
+ def to_body
512
+ to_hash
513
+ end
514
+
515
+ # Returns the object in the form of hash
516
+ # @return [Hash] Returns the object in the form of hash
517
+ def to_hash
518
+ hash = {}
519
+ self.class.attribute_map.each_pair do |attr, param|
520
+ value = self.send(attr)
521
+ next if value.nil?
522
+ hash[param] = _to_hash(value)
523
+ end
524
+ hash
525
+ end
526
+
527
+ # Outputs non-array value in the form of hash
528
+ # For object, use to_hash. Otherwise, just return the value
529
+ # @param [Object] value Any valid value
530
+ # @return [Hash] Returns the value in the form of hash
531
+ def _to_hash(value)
532
+ if value.is_a?(Array)
533
+ value.compact.map{ |v| _to_hash(v) }
534
+ elsif value.is_a?(Hash)
535
+ {}.tap do |hash|
536
+ value.each { |k, v| hash[k] = _to_hash(v) }
537
+ end
538
+ elsif value.respond_to? :to_hash
539
+ value.to_hash
540
+ else
541
+ value
542
+ end
543
+ end
544
+
545
+ end
546
+ end