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