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,388 @@
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 PricingTableInput < ApiModelBase
18
+ # Unique in the environment.
19
+ attr_accessor :key
20
+
21
+ attr_accessor :name
22
+
23
+ # A live table needs at least one column.
24
+ attr_accessor :active
25
+
26
+ attr_accessor :seller_entity_id
27
+
28
+ attr_accessor :currencies
29
+
30
+ attr_accessor :default_currency
31
+
32
+ attr_accessor :interval_toggle
33
+
34
+ attr_accessor :cta_label
35
+
36
+ # An http(s) or relative URL.
37
+ attr_accessor :cta_url_template
38
+
39
+ attr_accessor :columns
40
+
41
+ attr_accessor :features
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+ :'key' => :'key',
47
+ :'name' => :'name',
48
+ :'active' => :'active',
49
+ :'seller_entity_id' => :'seller_entity_id',
50
+ :'currencies' => :'currencies',
51
+ :'default_currency' => :'default_currency',
52
+ :'interval_toggle' => :'interval_toggle',
53
+ :'cta_label' => :'cta_label',
54
+ :'cta_url_template' => :'cta_url_template',
55
+ :'columns' => :'columns',
56
+ :'features' => :'features'
57
+ }
58
+ end
59
+
60
+ # Returns attribute mapping this model knows about
61
+ def self.acceptable_attribute_map
62
+ attribute_map
63
+ end
64
+
65
+ # Returns all the JSON keys this model knows about
66
+ def self.acceptable_attributes
67
+ acceptable_attribute_map.values
68
+ end
69
+
70
+ # Attribute type mapping.
71
+ def self.openapi_types
72
+ {
73
+ :'key' => :'String',
74
+ :'name' => :'String',
75
+ :'active' => :'Boolean',
76
+ :'seller_entity_id' => :'String',
77
+ :'currencies' => :'Array<String>',
78
+ :'default_currency' => :'String',
79
+ :'interval_toggle' => :'Boolean',
80
+ :'cta_label' => :'String',
81
+ :'cta_url_template' => :'String',
82
+ :'columns' => :'Array<PricingTableColumn>',
83
+ :'features' => :'Array<String>'
84
+ }
85
+ end
86
+
87
+ # List of attributes with nullable: true
88
+ def self.openapi_nullable
89
+ Set.new([
90
+ ])
91
+ end
92
+
93
+ # Returns attribute type mapping
94
+ def self.acceptable_openapi_types
95
+ openapi_types
96
+ end
97
+
98
+ # Returns the nullable attributes
99
+ def self.acceptable_openapi_nullable
100
+ openapi_nullable
101
+ end
102
+
103
+ # Initializes the object
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ def initialize(attributes = {})
106
+ if (!attributes.is_a?(Hash))
107
+ fail ArgumentError, "The input argument (attributes) must be a hash in `CboxBilling::PricingTableInput` initialize method"
108
+ end
109
+
110
+ # check to see if the attribute exists and convert string to symbol for hash key
111
+ acceptable_attribute_map = self.class.acceptable_attribute_map
112
+ attributes = attributes.each_with_object({}) { |(k, v), h|
113
+ if (!acceptable_attribute_map.key?(k.to_sym))
114
+ fail ArgumentError, "`#{k}` is not a valid attribute in `CboxBilling::PricingTableInput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
115
+ end
116
+ h[k.to_sym] = v
117
+ }
118
+
119
+ if attributes.key?(:'key')
120
+ self.key = attributes[:'key']
121
+ else
122
+ self.key = nil
123
+ end
124
+
125
+ if attributes.key?(:'name')
126
+ self.name = attributes[:'name']
127
+ else
128
+ self.name = nil
129
+ end
130
+
131
+ if attributes.key?(:'active')
132
+ self.active = attributes[:'active']
133
+ end
134
+
135
+ if attributes.key?(:'seller_entity_id')
136
+ self.seller_entity_id = attributes[:'seller_entity_id']
137
+ end
138
+
139
+ if attributes.key?(:'currencies')
140
+ if (value = attributes[:'currencies']).is_a?(Array)
141
+ self.currencies = value
142
+ end
143
+ end
144
+
145
+ if attributes.key?(:'default_currency')
146
+ self.default_currency = attributes[:'default_currency']
147
+ end
148
+
149
+ if attributes.key?(:'interval_toggle')
150
+ self.interval_toggle = attributes[:'interval_toggle']
151
+ end
152
+
153
+ if attributes.key?(:'cta_label')
154
+ self.cta_label = attributes[:'cta_label']
155
+ end
156
+
157
+ if attributes.key?(:'cta_url_template')
158
+ self.cta_url_template = attributes[:'cta_url_template']
159
+ end
160
+
161
+ if attributes.key?(:'columns')
162
+ if (value = attributes[:'columns']).is_a?(Array)
163
+ self.columns = value
164
+ end
165
+ end
166
+
167
+ if attributes.key?(:'features')
168
+ if (value = attributes[:'features']).is_a?(Array)
169
+ self.features = value
170
+ end
171
+ end
172
+ end
173
+
174
+ # Show invalid properties with the reasons. Usually used together with valid?
175
+ # @return Array for valid properties with the reasons
176
+ def list_invalid_properties
177
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
178
+ invalid_properties = Array.new
179
+ if @key.nil?
180
+ invalid_properties.push('invalid value for "key", key cannot be nil.')
181
+ end
182
+
183
+ if @key.to_s.length > 120
184
+ invalid_properties.push('invalid value for "key", the character length must be smaller than or equal to 120.')
185
+ end
186
+
187
+ pattern = Regexp.new(/^[a-z0-9._-]+$/)
188
+ if @key !~ pattern
189
+ invalid_properties.push("invalid value for \"key\", must conform to the pattern #{pattern}.")
190
+ end
191
+
192
+ if @name.nil?
193
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
194
+ end
195
+
196
+ if @name.to_s.length > 160
197
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 160.')
198
+ end
199
+
200
+ if !@default_currency.nil? && @default_currency.to_s.length > 3
201
+ invalid_properties.push('invalid value for "default_currency", the character length must be smaller than or equal to 3.')
202
+ end
203
+
204
+ if !@default_currency.nil? && @default_currency.to_s.length < 3
205
+ invalid_properties.push('invalid value for "default_currency", the character length must be greater than or equal to 3.')
206
+ end
207
+
208
+ if !@cta_label.nil? && @cta_label.to_s.length > 80
209
+ invalid_properties.push('invalid value for "cta_label", the character length must be smaller than or equal to 80.')
210
+ end
211
+
212
+ if !@cta_url_template.nil? && @cta_url_template.to_s.length > 2048
213
+ invalid_properties.push('invalid value for "cta_url_template", the character length must be smaller than or equal to 2048.')
214
+ end
215
+
216
+ invalid_properties
217
+ end
218
+
219
+ # Check to see if the all the properties in the model are valid
220
+ # @return true if the model is valid
221
+ def valid?
222
+ warn '[DEPRECATED] the `valid?` method is obsolete'
223
+ return false if @key.nil?
224
+ return false if @key.to_s.length > 120
225
+ return false if @key !~ Regexp.new(/^[a-z0-9._-]+$/)
226
+ return false if @name.nil?
227
+ return false if @name.to_s.length > 160
228
+ return false if !@default_currency.nil? && @default_currency.to_s.length > 3
229
+ return false if !@default_currency.nil? && @default_currency.to_s.length < 3
230
+ return false if !@cta_label.nil? && @cta_label.to_s.length > 80
231
+ return false if !@cta_url_template.nil? && @cta_url_template.to_s.length > 2048
232
+ true
233
+ end
234
+
235
+ # Custom attribute writer method with validation
236
+ # @param [Object] key Value to be assigned
237
+ def key=(key)
238
+ if key.nil?
239
+ fail ArgumentError, 'key cannot be nil'
240
+ end
241
+
242
+ if key.to_s.length > 120
243
+ fail ArgumentError, 'invalid value for "key", the character length must be smaller than or equal to 120.'
244
+ end
245
+
246
+ pattern = Regexp.new(/^[a-z0-9._-]+$/)
247
+ if key !~ pattern
248
+ fail ArgumentError, "invalid value for \"key\", must conform to the pattern #{pattern}."
249
+ end
250
+
251
+ @key = key
252
+ end
253
+
254
+ # Custom attribute writer method with validation
255
+ # @param [Object] name Value to be assigned
256
+ def name=(name)
257
+ if name.nil?
258
+ fail ArgumentError, 'name cannot be nil'
259
+ end
260
+
261
+ if name.to_s.length > 160
262
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 160.'
263
+ end
264
+
265
+ @name = name
266
+ end
267
+
268
+ # Custom attribute writer method with validation
269
+ # @param [Object] default_currency Value to be assigned
270
+ def default_currency=(default_currency)
271
+ if default_currency.nil?
272
+ fail ArgumentError, 'default_currency cannot be nil'
273
+ end
274
+
275
+ if default_currency.to_s.length > 3
276
+ fail ArgumentError, 'invalid value for "default_currency", the character length must be smaller than or equal to 3.'
277
+ end
278
+
279
+ if default_currency.to_s.length < 3
280
+ fail ArgumentError, 'invalid value for "default_currency", the character length must be greater than or equal to 3.'
281
+ end
282
+
283
+ @default_currency = default_currency
284
+ end
285
+
286
+ # Custom attribute writer method with validation
287
+ # @param [Object] cta_label Value to be assigned
288
+ def cta_label=(cta_label)
289
+ if cta_label.nil?
290
+ fail ArgumentError, 'cta_label cannot be nil'
291
+ end
292
+
293
+ if cta_label.to_s.length > 80
294
+ fail ArgumentError, 'invalid value for "cta_label", the character length must be smaller than or equal to 80.'
295
+ end
296
+
297
+ @cta_label = cta_label
298
+ end
299
+
300
+ # Custom attribute writer method with validation
301
+ # @param [Object] cta_url_template Value to be assigned
302
+ def cta_url_template=(cta_url_template)
303
+ if cta_url_template.nil?
304
+ fail ArgumentError, 'cta_url_template cannot be nil'
305
+ end
306
+
307
+ if cta_url_template.to_s.length > 2048
308
+ fail ArgumentError, 'invalid value for "cta_url_template", the character length must be smaller than or equal to 2048.'
309
+ end
310
+
311
+ @cta_url_template = cta_url_template
312
+ end
313
+
314
+ # Checks equality by comparing each attribute.
315
+ # @param [Object] Object to be compared
316
+ def ==(o)
317
+ return true if self.equal?(o)
318
+ self.class == o.class &&
319
+ key == o.key &&
320
+ name == o.name &&
321
+ active == o.active &&
322
+ seller_entity_id == o.seller_entity_id &&
323
+ currencies == o.currencies &&
324
+ default_currency == o.default_currency &&
325
+ interval_toggle == o.interval_toggle &&
326
+ cta_label == o.cta_label &&
327
+ cta_url_template == o.cta_url_template &&
328
+ columns == o.columns &&
329
+ features == o.features
330
+ end
331
+
332
+ # @see the `==` method
333
+ # @param [Object] Object to be compared
334
+ def eql?(o)
335
+ self == o
336
+ end
337
+
338
+ # Calculates hash code according to all attributes.
339
+ # @return [Integer] Hash code
340
+ def hash
341
+ [key, name, active, seller_entity_id, currencies, default_currency, interval_toggle, cta_label, cta_url_template, columns, features].hash
342
+ end
343
+
344
+ # Builds the object from hash
345
+ # @param [Hash] attributes Model attributes in the form of hash
346
+ # @return [Object] Returns the model itself
347
+ def self.build_from_hash(attributes)
348
+ return nil unless attributes.is_a?(Hash)
349
+ attributes = attributes.transform_keys(&:to_sym)
350
+ # include attributes inherited from allOf parents (the nearest declaration wins)
351
+ map = acceptable_attribute_map
352
+ transformed_hash = {}
353
+ acceptable_openapi_types.each_pair do |key, type|
354
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
355
+ transformed_hash["#{key}"] = nil
356
+ elsif type =~ /\AArray<(.*)>/i
357
+ # check to ensure the input is an array given that the attribute
358
+ # is documented as an array but the input is not
359
+ if attributes[map[key]].is_a?(Array)
360
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
361
+ end
362
+ elsif !attributes[map[key]].nil?
363
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
364
+ end
365
+ end
366
+ new(transformed_hash)
367
+ end
368
+
369
+ # Returns the object in the form of hash
370
+ # @return [Hash] Returns the object in the form of hash
371
+ def to_hash
372
+ hash = {}
373
+ # include attributes inherited from allOf parents (the nearest declaration wins)
374
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
375
+ value = self.send(attr)
376
+ if value.nil?
377
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
378
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
379
+ end
380
+
381
+ hash[param] = _to_hash(value)
382
+ end
383
+ hash
384
+ end
385
+
386
+ end
387
+
388
+ end