app_token_api 1.0.0 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -7
  3. data/app_token_api.gemspec +1 -1
  4. data/lib/admin_api/api/app_token_api.rb +2 -2
  5. data/lib/admin_api/api/auto_generate_app_token_api.rb +2 -2
  6. data/lib/admin_api/api/card_api.rb +371 -0
  7. data/lib/admin_api/api/client_api.rb +368 -0
  8. data/lib/admin_api/api_client.rb +2 -2
  9. data/lib/admin_api/api_error.rb +1 -1
  10. data/lib/admin_api/auth_configuration.rb +4 -4
  11. data/lib/admin_api/configuration.rb +2 -2
  12. data/lib/admin_api/models/app_token.rb +1 -1
  13. data/lib/admin_api/models/card.rb +499 -0
  14. data/lib/admin_api/models/card_address.rb +271 -0
  15. data/lib/admin_api/models/client.rb +557 -0
  16. data/lib/admin_api/models/client_address.rb +281 -0
  17. data/lib/admin_api/models/employment.rb +216 -0
  18. data/lib/admin_api/models/page_card.rb +261 -0
  19. data/lib/admin_api/models/page_client.rb +261 -0
  20. data/lib/admin_api/models/sort.rb +236 -0
  21. data/lib/admin_api/version.rb +2 -2
  22. data/lib/admin_api.rb +1 -1
  23. data/spec/api/app_token_api_spec.rb +1 -1
  24. data/spec/api/card_api_spec.rb +88 -0
  25. data/spec/api/client_api_spec.rb +20 -27
  26. data/spec/api_client_spec.rb +1 -1
  27. data/spec/configuration_spec.rb +4 -4
  28. data/spec/models/app_token_spec.rb +1 -1
  29. data/spec/models/card_address_spec.rb +77 -0
  30. data/spec/models/card_spec.rb +215 -0
  31. data/spec/models/client_address_spec.rb +83 -0
  32. data/spec/models/client_spec.rb +162 -6
  33. data/spec/models/employment_spec.rb +59 -0
  34. data/spec/models/page_card_spec.rb +89 -0
  35. data/spec/models/page_client_spec.rb +1 -1
  36. data/spec/models/sort_spec.rb +1 -1
  37. data/spec/spec_helper.rb +1 -1
  38. metadata +24 -2
@@ -0,0 +1,499 @@
1
+ =begin
2
+ #Hydrogen Admin API
3
+
4
+ #The Hydrogen Admin API
5
+
6
+ OpenAPI spec version: 1.0.2
7
+ Contact: info@hydrogenplatform.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module AdminApi
16
+ # Card Object
17
+ class Card
18
+ attr_accessor :address
19
+
20
+ # businessId
21
+ attr_accessor :business_id
22
+
23
+ # cardHolderName
24
+ attr_accessor :card_holder_name
25
+
26
+ # card_image
27
+ attr_accessor :card_image
28
+
29
+ # cardIssuance
30
+ attr_accessor :card_issuance
31
+
32
+ # cardName
33
+ attr_accessor :card_name
34
+
35
+ # cardNetwork
36
+ attr_accessor :card_network
37
+
38
+ # cardProgramId
39
+ attr_accessor :card_program_id
40
+
41
+ # cardType
42
+ attr_accessor :card_type
43
+
44
+ # clientId
45
+ attr_accessor :client_id
46
+
47
+ attr_accessor :create_date
48
+
49
+ # creditLimit
50
+ attr_accessor :credit_limit
51
+
52
+ # currencyCode
53
+ attr_accessor :currency_code
54
+
55
+ # expiryDate
56
+ attr_accessor :expiry_date
57
+
58
+ # fulfillment
59
+ attr_accessor :fulfillment
60
+
61
+ attr_accessor :id
62
+
63
+ # institutionId
64
+ attr_accessor :institution_id
65
+
66
+ # institutionName
67
+ attr_accessor :institution_name
68
+
69
+ # is_active
70
+ attr_accessor :is_active
71
+
72
+ # is_pin_set
73
+ attr_accessor :is_pin_set
74
+
75
+ # is_primary
76
+ attr_accessor :is_primary
77
+
78
+ # is_reloadable
79
+ attr_accessor :is_reloadable
80
+
81
+ # mask
82
+ attr_accessor :mask
83
+
84
+ attr_accessor :metadata
85
+
86
+ # phoneNumber
87
+ attr_accessor :phone_number
88
+
89
+ # portfolioId
90
+ attr_accessor :portfolio_id
91
+
92
+ # prepaidAmount
93
+ attr_accessor :prepaid_amount
94
+
95
+ attr_accessor :secondary_id
96
+
97
+ # status
98
+ attr_accessor :status
99
+
100
+ attr_accessor :update_date
101
+
102
+ # Attribute mapping from ruby-style variable name to JSON key.
103
+ def self.attribute_map
104
+ {
105
+ :'address' => :'address',
106
+ :'business_id' => :'business_id',
107
+ :'card_holder_name' => :'card_holder_name',
108
+ :'card_image' => :'card_image',
109
+ :'card_issuance' => :'card_issuance',
110
+ :'card_name' => :'card_name',
111
+ :'card_network' => :'card_network',
112
+ :'card_program_id' => :'card_program_id',
113
+ :'card_type' => :'card_type',
114
+ :'client_id' => :'client_id',
115
+ :'create_date' => :'create_date',
116
+ :'credit_limit' => :'credit_limit',
117
+ :'currency_code' => :'currency_code',
118
+ :'expiry_date' => :'expiry_date',
119
+ :'fulfillment' => :'fulfillment',
120
+ :'id' => :'id',
121
+ :'institution_id' => :'institution_id',
122
+ :'institution_name' => :'institution_name',
123
+ :'is_active' => :'is_active',
124
+ :'is_pin_set' => :'is_pin_set',
125
+ :'is_primary' => :'is_primary',
126
+ :'is_reloadable' => :'is_reloadable',
127
+ :'mask' => :'mask',
128
+ :'metadata' => :'metadata',
129
+ :'phone_number' => :'phone_number',
130
+ :'portfolio_id' => :'portfolio_id',
131
+ :'prepaid_amount' => :'prepaid_amount',
132
+ :'secondary_id' => :'secondary_id',
133
+ :'status' => :'status',
134
+ :'update_date' => :'update_date'
135
+ }
136
+ end
137
+
138
+ # Attribute type mapping.
139
+ def self.swagger_types
140
+ {
141
+ :'address' => :'Array<CardAddress>',
142
+ :'business_id' => :'String',
143
+ :'card_holder_name' => :'String',
144
+ :'card_image' => :'String',
145
+ :'card_issuance' => :'String',
146
+ :'card_name' => :'String',
147
+ :'card_network' => :'String',
148
+ :'card_program_id' => :'String',
149
+ :'card_type' => :'String',
150
+ :'client_id' => :'String',
151
+ :'create_date' => :'DateTime',
152
+ :'credit_limit' => :'Float',
153
+ :'currency_code' => :'String',
154
+ :'expiry_date' => :'Date',
155
+ :'fulfillment' => :'String',
156
+ :'id' => :'String',
157
+ :'institution_id' => :'String',
158
+ :'institution_name' => :'String',
159
+ :'is_active' => :'BOOLEAN',
160
+ :'is_pin_set' => :'BOOLEAN',
161
+ :'is_primary' => :'BOOLEAN',
162
+ :'is_reloadable' => :'BOOLEAN',
163
+ :'mask' => :'String',
164
+ :'metadata' => :'Hash<String, String>',
165
+ :'phone_number' => :'String',
166
+ :'portfolio_id' => :'String',
167
+ :'prepaid_amount' => :'Float',
168
+ :'secondary_id' => :'String',
169
+ :'status' => :'String',
170
+ :'update_date' => :'DateTime'
171
+ }
172
+ end
173
+
174
+ # Initializes the object
175
+ # @param [Hash] attributes Model attributes in the form of hash
176
+ def initialize(attributes = {})
177
+ return unless attributes.is_a?(Hash)
178
+
179
+ # convert string to symbol for hash key
180
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
181
+
182
+ if attributes.has_key?(:'address')
183
+ if (value = attributes[:'address']).is_a?(Array)
184
+ self.address = value
185
+ end
186
+ end
187
+
188
+ if attributes.has_key?(:'business_id')
189
+ self.business_id = attributes[:'business_id']
190
+ end
191
+
192
+ if attributes.has_key?(:'card_holder_name')
193
+ self.card_holder_name = attributes[:'card_holder_name']
194
+ end
195
+
196
+ if attributes.has_key?(:'card_image')
197
+ self.card_image = attributes[:'card_image']
198
+ end
199
+
200
+ if attributes.has_key?(:'card_issuance')
201
+ self.card_issuance = attributes[:'card_issuance']
202
+ end
203
+
204
+ if attributes.has_key?(:'card_name')
205
+ self.card_name = attributes[:'card_name']
206
+ end
207
+
208
+ if attributes.has_key?(:'card_network')
209
+ self.card_network = attributes[:'card_network']
210
+ end
211
+
212
+ if attributes.has_key?(:'card_program_id')
213
+ self.card_program_id = attributes[:'card_program_id']
214
+ end
215
+
216
+ if attributes.has_key?(:'card_type')
217
+ self.card_type = attributes[:'card_type']
218
+ end
219
+
220
+ if attributes.has_key?(:'client_id')
221
+ self.client_id = attributes[:'client_id']
222
+ end
223
+
224
+ if attributes.has_key?(:'create_date')
225
+ self.create_date = attributes[:'create_date']
226
+ end
227
+
228
+ if attributes.has_key?(:'credit_limit')
229
+ self.credit_limit = attributes[:'credit_limit']
230
+ end
231
+
232
+ if attributes.has_key?(:'currency_code')
233
+ self.currency_code = attributes[:'currency_code']
234
+ end
235
+
236
+ if attributes.has_key?(:'expiry_date')
237
+ self.expiry_date = attributes[:'expiry_date']
238
+ end
239
+
240
+ if attributes.has_key?(:'fulfillment')
241
+ self.fulfillment = attributes[:'fulfillment']
242
+ end
243
+
244
+ if attributes.has_key?(:'id')
245
+ self.id = attributes[:'id']
246
+ end
247
+
248
+ if attributes.has_key?(:'institution_id')
249
+ self.institution_id = attributes[:'institution_id']
250
+ end
251
+
252
+ if attributes.has_key?(:'institution_name')
253
+ self.institution_name = attributes[:'institution_name']
254
+ end
255
+
256
+ if attributes.has_key?(:'is_active')
257
+ self.is_active = attributes[:'is_active']
258
+ end
259
+
260
+ if attributes.has_key?(:'is_pin_set')
261
+ self.is_pin_set = attributes[:'is_pin_set']
262
+ end
263
+
264
+ if attributes.has_key?(:'is_primary')
265
+ self.is_primary = attributes[:'is_primary']
266
+ end
267
+
268
+ if attributes.has_key?(:'is_reloadable')
269
+ self.is_reloadable = attributes[:'is_reloadable']
270
+ end
271
+
272
+ if attributes.has_key?(:'mask')
273
+ self.mask = attributes[:'mask']
274
+ end
275
+
276
+ if attributes.has_key?(:'metadata')
277
+ if (value = attributes[:'metadata']).is_a?(Hash)
278
+ self.metadata = value
279
+ end
280
+ end
281
+
282
+ if attributes.has_key?(:'phone_number')
283
+ self.phone_number = attributes[:'phone_number']
284
+ end
285
+
286
+ if attributes.has_key?(:'portfolio_id')
287
+ self.portfolio_id = attributes[:'portfolio_id']
288
+ end
289
+
290
+ if attributes.has_key?(:'prepaid_amount')
291
+ self.prepaid_amount = attributes[:'prepaid_amount']
292
+ end
293
+
294
+ if attributes.has_key?(:'secondary_id')
295
+ self.secondary_id = attributes[:'secondary_id']
296
+ end
297
+
298
+ if attributes.has_key?(:'status')
299
+ self.status = attributes[:'status']
300
+ end
301
+
302
+ if attributes.has_key?(:'update_date')
303
+ self.update_date = attributes[:'update_date']
304
+ end
305
+ end
306
+
307
+ # Show invalid properties with the reasons. Usually used together with valid?
308
+ # @return Array for valid properties with the reasons
309
+ def list_invalid_properties
310
+ invalid_properties = Array.new
311
+ if @card_holder_name.nil?
312
+ invalid_properties.push('invalid value for "card_holder_name", card_holder_name cannot be nil.')
313
+ end
314
+
315
+ if @card_issuance.nil?
316
+ invalid_properties.push('invalid value for "card_issuance", card_issuance cannot be nil.')
317
+ end
318
+
319
+ if @card_name.nil?
320
+ invalid_properties.push('invalid value for "card_name", card_name cannot be nil.')
321
+ end
322
+
323
+ if @card_type.nil?
324
+ invalid_properties.push('invalid value for "card_type", card_type cannot be nil.')
325
+ end
326
+
327
+ if @portfolio_id.nil?
328
+ invalid_properties.push('invalid value for "portfolio_id", portfolio_id cannot be nil.')
329
+ end
330
+
331
+ invalid_properties
332
+ end
333
+
334
+ # Check to see if the all the properties in the model are valid
335
+ # @return true if the model is valid
336
+ def valid?
337
+ return false if @card_holder_name.nil?
338
+ return false if @card_issuance.nil?
339
+ return false if @card_name.nil?
340
+ return false if @card_type.nil?
341
+ return false if @portfolio_id.nil?
342
+ true
343
+ end
344
+
345
+ # Checks equality by comparing each attribute.
346
+ # @param [Object] Object to be compared
347
+ def ==(o)
348
+ return true if self.equal?(o)
349
+ self.class == o.class &&
350
+ address == o.address &&
351
+ business_id == o.business_id &&
352
+ card_holder_name == o.card_holder_name &&
353
+ card_image == o.card_image &&
354
+ card_issuance == o.card_issuance &&
355
+ card_name == o.card_name &&
356
+ card_network == o.card_network &&
357
+ card_program_id == o.card_program_id &&
358
+ card_type == o.card_type &&
359
+ client_id == o.client_id &&
360
+ create_date == o.create_date &&
361
+ credit_limit == o.credit_limit &&
362
+ currency_code == o.currency_code &&
363
+ expiry_date == o.expiry_date &&
364
+ fulfillment == o.fulfillment &&
365
+ id == o.id &&
366
+ institution_id == o.institution_id &&
367
+ institution_name == o.institution_name &&
368
+ is_active == o.is_active &&
369
+ is_pin_set == o.is_pin_set &&
370
+ is_primary == o.is_primary &&
371
+ is_reloadable == o.is_reloadable &&
372
+ mask == o.mask &&
373
+ metadata == o.metadata &&
374
+ phone_number == o.phone_number &&
375
+ portfolio_id == o.portfolio_id &&
376
+ prepaid_amount == o.prepaid_amount &&
377
+ secondary_id == o.secondary_id &&
378
+ status == o.status &&
379
+ update_date == o.update_date
380
+ end
381
+
382
+ # @see the `==` method
383
+ # @param [Object] Object to be compared
384
+ def eql?(o)
385
+ self == o
386
+ end
387
+
388
+ # Calculates hash code according to all attributes.
389
+ # @return [Fixnum] Hash code
390
+ def hash
391
+ [address, business_id, card_holder_name, card_image, card_issuance, card_name, card_network, card_program_id, card_type, client_id, create_date, credit_limit, currency_code, expiry_date, fulfillment, id, institution_id, institution_name, is_active, is_pin_set, is_primary, is_reloadable, mask, metadata, phone_number, portfolio_id, prepaid_amount, secondary_id, status, update_date].hash
392
+ end
393
+
394
+ # Builds the object from hash
395
+ # @param [Hash] attributes Model attributes in the form of hash
396
+ # @return [Object] Returns the model itself
397
+ def build_from_hash(attributes)
398
+ return nil unless attributes.is_a?(Hash)
399
+ self.class.swagger_types.each_pair do |key, type|
400
+ if type =~ /\AArray<(.*)>/i
401
+ # check to ensure the input is an array given that the attribute
402
+ # is documented as an array but the input is not
403
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
404
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
405
+ end
406
+ elsif !attributes[self.class.attribute_map[key]].nil?
407
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
408
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
409
+ end
410
+
411
+ self
412
+ end
413
+
414
+ # Deserializes the data based on type
415
+ # @param string type Data type
416
+ # @param string value Value to be deserialized
417
+ # @return [Object] Deserialized data
418
+ def _deserialize(type, value)
419
+ case type.to_sym
420
+ when :DateTime
421
+ DateTime.parse(value)
422
+ when :Date
423
+ Date.parse(value)
424
+ when :String
425
+ value.to_s
426
+ when :Integer
427
+ value.to_i
428
+ when :Float
429
+ value.to_f
430
+ when :BOOLEAN
431
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
432
+ true
433
+ else
434
+ false
435
+ end
436
+ when :Object
437
+ # generic object (usually a Hash), return directly
438
+ value
439
+ when /\AArray<(?<inner_type>.+)>\z/
440
+ inner_type = Regexp.last_match[:inner_type]
441
+ value.map { |v| _deserialize(inner_type, v) }
442
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
443
+ k_type = Regexp.last_match[:k_type]
444
+ v_type = Regexp.last_match[:v_type]
445
+ {}.tap do |hash|
446
+ value.each do |k, v|
447
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
448
+ end
449
+ end
450
+ else # model
451
+ temp_model = AdminApi.const_get(type).new
452
+ temp_model.build_from_hash(value)
453
+ end
454
+ end
455
+
456
+ # Returns the string representation of the object
457
+ # @return [String] String presentation of the object
458
+ def to_s
459
+ to_hash.to_s
460
+ end
461
+
462
+ # to_body is an alias to to_hash (backward compatibility)
463
+ # @return [Hash] Returns the object in the form of hash
464
+ def to_body
465
+ to_hash
466
+ end
467
+
468
+ # Returns the object in the form of hash
469
+ # @return [Hash] Returns the object in the form of hash
470
+ def to_hash
471
+ hash = {}
472
+ self.class.attribute_map.each_pair do |attr, param|
473
+ value = self.send(attr)
474
+ next if value.nil?
475
+ hash[param] = _to_hash(value)
476
+ end
477
+ hash
478
+ end
479
+
480
+ # Outputs non-array value in the form of hash
481
+ # For object, use to_hash. Otherwise, just return the value
482
+ # @param [Object] value Any valid value
483
+ # @return [Hash] Returns the value in the form of hash
484
+ def _to_hash(value)
485
+ if value.is_a?(Array)
486
+ value.compact.map { |v| _to_hash(v) }
487
+ elsif value.is_a?(Hash)
488
+ {}.tap do |hash|
489
+ value.each { |k, v| hash[k] = _to_hash(v) }
490
+ end
491
+ elsif value.respond_to? :to_hash
492
+ value.to_hash
493
+ else
494
+ value
495
+ end
496
+ end
497
+
498
+ end
499
+ end