cbox_billing 0.1.0 → 0.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 (48) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cbox_billing/api/checkout_portal_api.rb +214 -0
  3. data/lib/cbox_billing/api/coupons_api.rb +55 -55
  4. data/lib/cbox_billing/api/experiments_api.rb +526 -0
  5. data/lib/cbox_billing/api/organizations_api.rb +554 -0
  6. data/lib/cbox_billing/api/pricing_tables_api.rb +519 -0
  7. data/lib/cbox_billing/api/retention_api.rb +884 -0
  8. data/lib/cbox_billing/api/sellers_api.rb +590 -0
  9. data/lib/cbox_billing/models/checkout_link.rb +283 -0
  10. data/lib/cbox_billing/models/conclude_experiment_request.rb +161 -0
  11. data/lib/cbox_billing/models/create_checkout_link_request.rb +178 -0
  12. data/lib/cbox_billing/models/customer_lifecycle_refusal.rb +238 -0
  13. data/lib/cbox_billing/models/customer_lifecycle_state.rb +268 -0
  14. data/lib/cbox_billing/models/delete_experiment200_response.rb +227 -0
  15. data/lib/cbox_billing/models/delete_organization200_response.rb +227 -0
  16. data/lib/cbox_billing/models/experiment.rb +387 -0
  17. data/lib/cbox_billing/models/experiment_input.rb +410 -0
  18. data/lib/cbox_billing/models/experiment_input_variants_inner.rb +233 -0
  19. data/lib/cbox_billing/models/experiment_variant.rb +266 -0
  20. data/lib/cbox_billing/models/list_checkout_links200_response.rb +179 -0
  21. data/lib/cbox_billing/models/list_checkout_links200_response_data_inner.rb +223 -0
  22. data/lib/cbox_billing/models/list_experiments200_response.rb +179 -0
  23. data/lib/cbox_billing/models/list_pricing_tables200_response.rb +179 -0
  24. data/lib/cbox_billing/models/list_retention_offers200_response.rb +179 -0
  25. data/lib/cbox_billing/models/list_retention_reasons200_response.rb +179 -0
  26. data/lib/cbox_billing/models/list_sellers200_response.rb +179 -0
  27. data/lib/cbox_billing/models/merge_organization_request.rb +221 -0
  28. data/lib/cbox_billing/models/merge_organization_request_fields.rb +279 -0
  29. data/lib/cbox_billing/models/preview_organization_merge200_response.rb +343 -0
  30. data/lib/cbox_billing/models/preview_organization_merge_request.rb +177 -0
  31. data/lib/cbox_billing/models/pricing_table.rb +426 -0
  32. data/lib/cbox_billing/models/pricing_table_column.rb +248 -0
  33. data/lib/cbox_billing/models/pricing_table_input.rb +388 -0
  34. data/lib/cbox_billing/models/retention_offer.rb +389 -0
  35. data/lib/cbox_billing/models/retention_offer_input.rb +447 -0
  36. data/lib/cbox_billing/models/retention_reason.rb +282 -0
  37. data/lib/cbox_billing/models/retention_reason_input.rb +195 -0
  38. data/lib/cbox_billing/models/revoke_checkout_link200_response.rb +227 -0
  39. data/lib/cbox_billing/models/seller.rb +551 -0
  40. data/lib/cbox_billing/models/seller_address.rb +201 -0
  41. data/lib/cbox_billing/models/seller_bank.rb +191 -0
  42. data/lib/cbox_billing/models/seller_input.rb +633 -0
  43. data/lib/cbox_billing/models/seller_input_registrations_inner.rb +188 -0
  44. data/lib/cbox_billing/models/seller_registrations_inner.rb +189 -0
  45. data/lib/cbox_billing/models/suspend_organization_request.rb +179 -0
  46. data/lib/cbox_billing/version.rb +1 -1
  47. data/lib/cbox_billing.rb +41 -0
  48. metadata +42 -1
@@ -0,0 +1,551 @@
1
+ =begin
2
+ #Cbox Billing API
3
+
4
+ #The HTTP API of Cbox Billing. Reference: https://github.com/cboxdk/cbox-billing/tree/main/docs/api
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.26.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module CboxBilling
17
+ class Seller < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :legal_name
21
+
22
+ attr_accessor :registration_number
23
+
24
+ # ISO 3166-1 alpha-2.
25
+ attr_accessor :establishment
26
+
27
+ attr_accessor :currency
28
+
29
+ attr_accessor :invoice_prefix
30
+
31
+ attr_accessor :is_default
32
+
33
+ attr_accessor :archived
34
+
35
+ attr_accessor :timezone
36
+
37
+ attr_accessor :invoice_draft_mode
38
+
39
+ attr_accessor :invoice_draft_grace_hours
40
+
41
+ attr_accessor :address
42
+
43
+ # What a document cannot be issued without.
44
+ attr_accessor :address_missing
45
+
46
+ attr_accessor :bank
47
+
48
+ attr_accessor :registrations
49
+
50
+ attr_accessor :branding
51
+
52
+ attr_accessor :has_document_logo
53
+
54
+ # Attribute mapping from ruby-style variable name to JSON key.
55
+ def self.attribute_map
56
+ {
57
+ :'id' => :'id',
58
+ :'legal_name' => :'legal_name',
59
+ :'registration_number' => :'registration_number',
60
+ :'establishment' => :'establishment',
61
+ :'currency' => :'currency',
62
+ :'invoice_prefix' => :'invoice_prefix',
63
+ :'is_default' => :'is_default',
64
+ :'archived' => :'archived',
65
+ :'timezone' => :'timezone',
66
+ :'invoice_draft_mode' => :'invoice_draft_mode',
67
+ :'invoice_draft_grace_hours' => :'invoice_draft_grace_hours',
68
+ :'address' => :'address',
69
+ :'address_missing' => :'address_missing',
70
+ :'bank' => :'bank',
71
+ :'registrations' => :'registrations',
72
+ :'branding' => :'branding',
73
+ :'has_document_logo' => :'has_document_logo'
74
+ }
75
+ end
76
+
77
+ # Returns attribute mapping this model knows about
78
+ def self.acceptable_attribute_map
79
+ attribute_map
80
+ end
81
+
82
+ # Returns all the JSON keys this model knows about
83
+ def self.acceptable_attributes
84
+ acceptable_attribute_map.values
85
+ end
86
+
87
+ # Attribute type mapping.
88
+ def self.openapi_types
89
+ {
90
+ :'id' => :'String',
91
+ :'legal_name' => :'String',
92
+ :'registration_number' => :'String',
93
+ :'establishment' => :'String',
94
+ :'currency' => :'String',
95
+ :'invoice_prefix' => :'String',
96
+ :'is_default' => :'Boolean',
97
+ :'archived' => :'Boolean',
98
+ :'timezone' => :'String',
99
+ :'invoice_draft_mode' => :'Boolean',
100
+ :'invoice_draft_grace_hours' => :'Integer',
101
+ :'address' => :'SellerAddress',
102
+ :'address_missing' => :'Array<String>',
103
+ :'bank' => :'SellerBank',
104
+ :'registrations' => :'Array<SellerRegistrationsInner>',
105
+ :'branding' => :'Hash<String, String>',
106
+ :'has_document_logo' => :'Boolean'
107
+ }
108
+ end
109
+
110
+ # List of attributes with nullable: true
111
+ def self.openapi_nullable
112
+ Set.new([
113
+ :'timezone',
114
+ ])
115
+ end
116
+
117
+ # Returns attribute type mapping
118
+ def self.acceptable_openapi_types
119
+ openapi_types
120
+ end
121
+
122
+ # Returns the nullable attributes
123
+ def self.acceptable_openapi_nullable
124
+ openapi_nullable
125
+ end
126
+
127
+ # Initializes the object
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ def initialize(attributes = {})
130
+ if (!attributes.is_a?(Hash))
131
+ fail ArgumentError, "The input argument (attributes) must be a hash in `CboxBilling::Seller` initialize method"
132
+ end
133
+
134
+ # check to see if the attribute exists and convert string to symbol for hash key
135
+ acceptable_attribute_map = self.class.acceptable_attribute_map
136
+ attributes = attributes.each_with_object({}) { |(k, v), h|
137
+ if (!acceptable_attribute_map.key?(k.to_sym))
138
+ fail ArgumentError, "`#{k}` is not a valid attribute in `CboxBilling::Seller`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
139
+ end
140
+ h[k.to_sym] = v
141
+ }
142
+
143
+ if attributes.key?(:'id')
144
+ self.id = attributes[:'id']
145
+ else
146
+ self.id = nil
147
+ end
148
+
149
+ if attributes.key?(:'legal_name')
150
+ self.legal_name = attributes[:'legal_name']
151
+ else
152
+ self.legal_name = nil
153
+ end
154
+
155
+ if attributes.key?(:'registration_number')
156
+ self.registration_number = attributes[:'registration_number']
157
+ else
158
+ self.registration_number = nil
159
+ end
160
+
161
+ if attributes.key?(:'establishment')
162
+ self.establishment = attributes[:'establishment']
163
+ else
164
+ self.establishment = nil
165
+ end
166
+
167
+ if attributes.key?(:'currency')
168
+ self.currency = attributes[:'currency']
169
+ else
170
+ self.currency = nil
171
+ end
172
+
173
+ if attributes.key?(:'invoice_prefix')
174
+ self.invoice_prefix = attributes[:'invoice_prefix']
175
+ else
176
+ self.invoice_prefix = nil
177
+ end
178
+
179
+ if attributes.key?(:'is_default')
180
+ self.is_default = attributes[:'is_default']
181
+ else
182
+ self.is_default = nil
183
+ end
184
+
185
+ if attributes.key?(:'archived')
186
+ self.archived = attributes[:'archived']
187
+ else
188
+ self.archived = nil
189
+ end
190
+
191
+ if attributes.key?(:'timezone')
192
+ self.timezone = attributes[:'timezone']
193
+ end
194
+
195
+ if attributes.key?(:'invoice_draft_mode')
196
+ self.invoice_draft_mode = attributes[:'invoice_draft_mode']
197
+ end
198
+
199
+ if attributes.key?(:'invoice_draft_grace_hours')
200
+ self.invoice_draft_grace_hours = attributes[:'invoice_draft_grace_hours']
201
+ end
202
+
203
+ if attributes.key?(:'address')
204
+ self.address = attributes[:'address']
205
+ else
206
+ self.address = nil
207
+ end
208
+
209
+ if attributes.key?(:'address_missing')
210
+ if (value = attributes[:'address_missing']).is_a?(Array)
211
+ self.address_missing = value
212
+ end
213
+ else
214
+ self.address_missing = nil
215
+ end
216
+
217
+ if attributes.key?(:'bank')
218
+ self.bank = attributes[:'bank']
219
+ else
220
+ self.bank = nil
221
+ end
222
+
223
+ if attributes.key?(:'registrations')
224
+ if (value = attributes[:'registrations']).is_a?(Array)
225
+ self.registrations = value
226
+ end
227
+ else
228
+ self.registrations = nil
229
+ end
230
+
231
+ if attributes.key?(:'branding')
232
+ if (value = attributes[:'branding']).is_a?(Hash)
233
+ self.branding = value
234
+ end
235
+ else
236
+ self.branding = nil
237
+ end
238
+
239
+ if attributes.key?(:'has_document_logo')
240
+ self.has_document_logo = attributes[:'has_document_logo']
241
+ else
242
+ self.has_document_logo = nil
243
+ end
244
+ end
245
+
246
+ # Show invalid properties with the reasons. Usually used together with valid?
247
+ # @return Array for valid properties with the reasons
248
+ def list_invalid_properties
249
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
250
+ invalid_properties = Array.new
251
+ if @id.nil?
252
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
253
+ end
254
+
255
+ if @legal_name.nil?
256
+ invalid_properties.push('invalid value for "legal_name", legal_name cannot be nil.')
257
+ end
258
+
259
+ if @registration_number.nil?
260
+ invalid_properties.push('invalid value for "registration_number", registration_number cannot be nil.')
261
+ end
262
+
263
+ if @establishment.nil?
264
+ invalid_properties.push('invalid value for "establishment", establishment cannot be nil.')
265
+ end
266
+
267
+ if @currency.nil?
268
+ invalid_properties.push('invalid value for "currency", currency cannot be nil.')
269
+ end
270
+
271
+ if @invoice_prefix.nil?
272
+ invalid_properties.push('invalid value for "invoice_prefix", invoice_prefix cannot be nil.')
273
+ end
274
+
275
+ if @is_default.nil?
276
+ invalid_properties.push('invalid value for "is_default", is_default cannot be nil.')
277
+ end
278
+
279
+ if @archived.nil?
280
+ invalid_properties.push('invalid value for "archived", archived cannot be nil.')
281
+ end
282
+
283
+ if @address.nil?
284
+ invalid_properties.push('invalid value for "address", address cannot be nil.')
285
+ end
286
+
287
+ if @address_missing.nil?
288
+ invalid_properties.push('invalid value for "address_missing", address_missing cannot be nil.')
289
+ end
290
+
291
+ if @bank.nil?
292
+ invalid_properties.push('invalid value for "bank", bank cannot be nil.')
293
+ end
294
+
295
+ if @registrations.nil?
296
+ invalid_properties.push('invalid value for "registrations", registrations cannot be nil.')
297
+ end
298
+
299
+ if @branding.nil?
300
+ invalid_properties.push('invalid value for "branding", branding cannot be nil.')
301
+ end
302
+
303
+ if @has_document_logo.nil?
304
+ invalid_properties.push('invalid value for "has_document_logo", has_document_logo cannot be nil.')
305
+ end
306
+
307
+ invalid_properties
308
+ end
309
+
310
+ # Check to see if the all the properties in the model are valid
311
+ # @return true if the model is valid
312
+ def valid?
313
+ warn '[DEPRECATED] the `valid?` method is obsolete'
314
+ return false if @id.nil?
315
+ return false if @legal_name.nil?
316
+ return false if @registration_number.nil?
317
+ return false if @establishment.nil?
318
+ return false if @currency.nil?
319
+ return false if @invoice_prefix.nil?
320
+ return false if @is_default.nil?
321
+ return false if @archived.nil?
322
+ return false if @address.nil?
323
+ return false if @address_missing.nil?
324
+ return false if @bank.nil?
325
+ return false if @registrations.nil?
326
+ return false if @branding.nil?
327
+ return false if @has_document_logo.nil?
328
+ true
329
+ end
330
+
331
+ # Custom attribute writer method with validation
332
+ # @param [Object] id Value to be assigned
333
+ def id=(id)
334
+ if id.nil?
335
+ fail ArgumentError, 'id cannot be nil'
336
+ end
337
+
338
+ @id = id
339
+ end
340
+
341
+ # Custom attribute writer method with validation
342
+ # @param [Object] legal_name Value to be assigned
343
+ def legal_name=(legal_name)
344
+ if legal_name.nil?
345
+ fail ArgumentError, 'legal_name cannot be nil'
346
+ end
347
+
348
+ @legal_name = legal_name
349
+ end
350
+
351
+ # Custom attribute writer method with validation
352
+ # @param [Object] registration_number Value to be assigned
353
+ def registration_number=(registration_number)
354
+ if registration_number.nil?
355
+ fail ArgumentError, 'registration_number cannot be nil'
356
+ end
357
+
358
+ @registration_number = registration_number
359
+ end
360
+
361
+ # Custom attribute writer method with validation
362
+ # @param [Object] establishment Value to be assigned
363
+ def establishment=(establishment)
364
+ if establishment.nil?
365
+ fail ArgumentError, 'establishment cannot be nil'
366
+ end
367
+
368
+ @establishment = establishment
369
+ end
370
+
371
+ # Custom attribute writer method with validation
372
+ # @param [Object] currency Value to be assigned
373
+ def currency=(currency)
374
+ if currency.nil?
375
+ fail ArgumentError, 'currency cannot be nil'
376
+ end
377
+
378
+ @currency = currency
379
+ end
380
+
381
+ # Custom attribute writer method with validation
382
+ # @param [Object] invoice_prefix Value to be assigned
383
+ def invoice_prefix=(invoice_prefix)
384
+ if invoice_prefix.nil?
385
+ fail ArgumentError, 'invoice_prefix cannot be nil'
386
+ end
387
+
388
+ @invoice_prefix = invoice_prefix
389
+ end
390
+
391
+ # Custom attribute writer method with validation
392
+ # @param [Object] is_default Value to be assigned
393
+ def is_default=(is_default)
394
+ if is_default.nil?
395
+ fail ArgumentError, 'is_default cannot be nil'
396
+ end
397
+
398
+ @is_default = is_default
399
+ end
400
+
401
+ # Custom attribute writer method with validation
402
+ # @param [Object] archived Value to be assigned
403
+ def archived=(archived)
404
+ if archived.nil?
405
+ fail ArgumentError, 'archived cannot be nil'
406
+ end
407
+
408
+ @archived = archived
409
+ end
410
+
411
+ # Custom attribute writer method with validation
412
+ # @param [Object] address Value to be assigned
413
+ def address=(address)
414
+ if address.nil?
415
+ fail ArgumentError, 'address cannot be nil'
416
+ end
417
+
418
+ @address = address
419
+ end
420
+
421
+ # Custom attribute writer method with validation
422
+ # @param [Object] address_missing Value to be assigned
423
+ def address_missing=(address_missing)
424
+ if address_missing.nil?
425
+ fail ArgumentError, 'address_missing cannot be nil'
426
+ end
427
+
428
+ @address_missing = address_missing
429
+ end
430
+
431
+ # Custom attribute writer method with validation
432
+ # @param [Object] bank Value to be assigned
433
+ def bank=(bank)
434
+ if bank.nil?
435
+ fail ArgumentError, 'bank cannot be nil'
436
+ end
437
+
438
+ @bank = bank
439
+ end
440
+
441
+ # Custom attribute writer method with validation
442
+ # @param [Object] registrations Value to be assigned
443
+ def registrations=(registrations)
444
+ if registrations.nil?
445
+ fail ArgumentError, 'registrations cannot be nil'
446
+ end
447
+
448
+ @registrations = registrations
449
+ end
450
+
451
+ # Custom attribute writer method with validation
452
+ # @param [Object] branding Value to be assigned
453
+ def branding=(branding)
454
+ if branding.nil?
455
+ fail ArgumentError, 'branding cannot be nil'
456
+ end
457
+
458
+ @branding = branding
459
+ end
460
+
461
+ # Custom attribute writer method with validation
462
+ # @param [Object] has_document_logo Value to be assigned
463
+ def has_document_logo=(has_document_logo)
464
+ if has_document_logo.nil?
465
+ fail ArgumentError, 'has_document_logo cannot be nil'
466
+ end
467
+
468
+ @has_document_logo = has_document_logo
469
+ end
470
+
471
+ # Checks equality by comparing each attribute.
472
+ # @param [Object] Object to be compared
473
+ def ==(o)
474
+ return true if self.equal?(o)
475
+ self.class == o.class &&
476
+ id == o.id &&
477
+ legal_name == o.legal_name &&
478
+ registration_number == o.registration_number &&
479
+ establishment == o.establishment &&
480
+ currency == o.currency &&
481
+ invoice_prefix == o.invoice_prefix &&
482
+ is_default == o.is_default &&
483
+ archived == o.archived &&
484
+ timezone == o.timezone &&
485
+ invoice_draft_mode == o.invoice_draft_mode &&
486
+ invoice_draft_grace_hours == o.invoice_draft_grace_hours &&
487
+ address == o.address &&
488
+ address_missing == o.address_missing &&
489
+ bank == o.bank &&
490
+ registrations == o.registrations &&
491
+ branding == o.branding &&
492
+ has_document_logo == o.has_document_logo
493
+ end
494
+
495
+ # @see the `==` method
496
+ # @param [Object] Object to be compared
497
+ def eql?(o)
498
+ self == o
499
+ end
500
+
501
+ # Calculates hash code according to all attributes.
502
+ # @return [Integer] Hash code
503
+ def hash
504
+ [id, legal_name, registration_number, establishment, currency, invoice_prefix, is_default, archived, timezone, invoice_draft_mode, invoice_draft_grace_hours, address, address_missing, bank, registrations, branding, has_document_logo].hash
505
+ end
506
+
507
+ # Builds the object from hash
508
+ # @param [Hash] attributes Model attributes in the form of hash
509
+ # @return [Object] Returns the model itself
510
+ def self.build_from_hash(attributes)
511
+ return nil unless attributes.is_a?(Hash)
512
+ attributes = attributes.transform_keys(&:to_sym)
513
+ # include attributes inherited from allOf parents (the nearest declaration wins)
514
+ map = acceptable_attribute_map
515
+ transformed_hash = {}
516
+ acceptable_openapi_types.each_pair do |key, type|
517
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
518
+ transformed_hash["#{key}"] = nil
519
+ elsif type =~ /\AArray<(.*)>/i
520
+ # check to ensure the input is an array given that the attribute
521
+ # is documented as an array but the input is not
522
+ if attributes[map[key]].is_a?(Array)
523
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
524
+ end
525
+ elsif !attributes[map[key]].nil?
526
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
527
+ end
528
+ end
529
+ new(transformed_hash)
530
+ end
531
+
532
+ # Returns the object in the form of hash
533
+ # @return [Hash] Returns the object in the form of hash
534
+ def to_hash
535
+ hash = {}
536
+ # include attributes inherited from allOf parents (the nearest declaration wins)
537
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
538
+ value = self.send(attr)
539
+ if value.nil?
540
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
541
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
542
+ end
543
+
544
+ hash[param] = _to_hash(value)
545
+ end
546
+ hash
547
+ end
548
+
549
+ end
550
+
551
+ end