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,179 @@
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 ListSellers200Response < ApiModelBase
18
+ attr_accessor :data
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'data' => :'data'
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
+ :'data' => :'Array<Seller>'
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::ListSellers200Response` 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::ListSellers200Response`. 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?(:'data')
77
+ if (value = attributes[:'data']).is_a?(Array)
78
+ self.data = value
79
+ end
80
+ else
81
+ self.data = nil
82
+ end
83
+ end
84
+
85
+ # Show invalid properties with the reasons. Usually used together with valid?
86
+ # @return Array for valid properties with the reasons
87
+ def list_invalid_properties
88
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
89
+ invalid_properties = Array.new
90
+ if @data.nil?
91
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
92
+ end
93
+
94
+ invalid_properties
95
+ end
96
+
97
+ # Check to see if the all the properties in the model are valid
98
+ # @return true if the model is valid
99
+ def valid?
100
+ warn '[DEPRECATED] the `valid?` method is obsolete'
101
+ return false if @data.nil?
102
+ true
103
+ end
104
+
105
+ # Custom attribute writer method with validation
106
+ # @param [Object] data Value to be assigned
107
+ def data=(data)
108
+ if data.nil?
109
+ fail ArgumentError, 'data cannot be nil'
110
+ end
111
+
112
+ @data = data
113
+ end
114
+
115
+ # Checks equality by comparing each attribute.
116
+ # @param [Object] Object to be compared
117
+ def ==(o)
118
+ return true if self.equal?(o)
119
+ self.class == o.class &&
120
+ data == o.data
121
+ end
122
+
123
+ # @see the `==` method
124
+ # @param [Object] Object to be compared
125
+ def eql?(o)
126
+ self == o
127
+ end
128
+
129
+ # Calculates hash code according to all attributes.
130
+ # @return [Integer] Hash code
131
+ def hash
132
+ [data].hash
133
+ end
134
+
135
+ # Builds the object from hash
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ # @return [Object] Returns the model itself
138
+ def self.build_from_hash(attributes)
139
+ return nil unless attributes.is_a?(Hash)
140
+ attributes = attributes.transform_keys(&:to_sym)
141
+ # include attributes inherited from allOf parents (the nearest declaration wins)
142
+ map = acceptable_attribute_map
143
+ transformed_hash = {}
144
+ acceptable_openapi_types.each_pair do |key, type|
145
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
146
+ transformed_hash["#{key}"] = nil
147
+ elsif type =~ /\AArray<(.*)>/i
148
+ # check to ensure the input is an array given that the attribute
149
+ # is documented as an array but the input is not
150
+ if attributes[map[key]].is_a?(Array)
151
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
152
+ end
153
+ elsif !attributes[map[key]].nil?
154
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
155
+ end
156
+ end
157
+ new(transformed_hash)
158
+ end
159
+
160
+ # Returns the object in the form of hash
161
+ # @return [Hash] Returns the object in the form of hash
162
+ def to_hash
163
+ hash = {}
164
+ # include attributes inherited from allOf parents (the nearest declaration wins)
165
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
166
+ value = self.send(attr)
167
+ if value.nil?
168
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
169
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
170
+ end
171
+
172
+ hash[param] = _to_hash(value)
173
+ end
174
+ hash
175
+ end
176
+
177
+ end
178
+
179
+ end
@@ -0,0 +1,221 @@
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 MergeOrganizationRequest < ApiModelBase
18
+ # The organization that stays.
19
+ attr_accessor :into
20
+
21
+ attr_accessor :fields
22
+
23
+ # Per product both customers have live (the preview's `conflicts`, by `product`), whose subscription stays. The other ends quietly, without a refund.
24
+ attr_accessor :keep
25
+
26
+ class EnumAttributeValidator
27
+ attr_reader :datatype
28
+ attr_reader :allowable_values
29
+
30
+ def initialize(datatype, allowable_values)
31
+ @allowable_values = allowable_values.map do |value|
32
+ case datatype.to_s
33
+ when /Integer/i
34
+ value.to_i
35
+ when /Float/i
36
+ value.to_f
37
+ else
38
+ value
39
+ end
40
+ end
41
+ end
42
+
43
+ def valid?(value)
44
+ !value || allowable_values.include?(value)
45
+ end
46
+ end
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'into' => :'into',
52
+ :'fields' => :'fields',
53
+ :'keep' => :'keep'
54
+ }
55
+ end
56
+
57
+ # Returns attribute mapping this model knows about
58
+ def self.acceptable_attribute_map
59
+ attribute_map
60
+ end
61
+
62
+ # Returns all the JSON keys this model knows about
63
+ def self.acceptable_attributes
64
+ acceptable_attribute_map.values
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.openapi_types
69
+ {
70
+ :'into' => :'String',
71
+ :'fields' => :'MergeOrganizationRequestFields',
72
+ :'keep' => :'Hash<String, String>'
73
+ }
74
+ end
75
+
76
+ # List of attributes with nullable: true
77
+ def self.openapi_nullable
78
+ Set.new([
79
+ ])
80
+ end
81
+
82
+ # Returns attribute type mapping
83
+ def self.acceptable_openapi_types
84
+ openapi_types
85
+ end
86
+
87
+ # Returns the nullable attributes
88
+ def self.acceptable_openapi_nullable
89
+ openapi_nullable
90
+ end
91
+
92
+ # Initializes the object
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ def initialize(attributes = {})
95
+ if (!attributes.is_a?(Hash))
96
+ fail ArgumentError, "The input argument (attributes) must be a hash in `CboxBilling::MergeOrganizationRequest` initialize method"
97
+ end
98
+
99
+ # check to see if the attribute exists and convert string to symbol for hash key
100
+ acceptable_attribute_map = self.class.acceptable_attribute_map
101
+ attributes = attributes.each_with_object({}) { |(k, v), h|
102
+ if (!acceptable_attribute_map.key?(k.to_sym))
103
+ fail ArgumentError, "`#{k}` is not a valid attribute in `CboxBilling::MergeOrganizationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
104
+ end
105
+ h[k.to_sym] = v
106
+ }
107
+
108
+ if attributes.key?(:'into')
109
+ self.into = attributes[:'into']
110
+ else
111
+ self.into = nil
112
+ end
113
+
114
+ if attributes.key?(:'fields')
115
+ self.fields = attributes[:'fields']
116
+ end
117
+
118
+ if attributes.key?(:'keep')
119
+ if (value = attributes[:'keep']).is_a?(Hash)
120
+ self.keep = value
121
+ end
122
+ end
123
+ end
124
+
125
+ # Show invalid properties with the reasons. Usually used together with valid?
126
+ # @return Array for valid properties with the reasons
127
+ def list_invalid_properties
128
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
129
+ invalid_properties = Array.new
130
+ if @into.nil?
131
+ invalid_properties.push('invalid value for "into", into cannot be nil.')
132
+ end
133
+
134
+ invalid_properties
135
+ end
136
+
137
+ # Check to see if the all the properties in the model are valid
138
+ # @return true if the model is valid
139
+ def valid?
140
+ warn '[DEPRECATED] the `valid?` method is obsolete'
141
+ return false if @into.nil?
142
+ true
143
+ end
144
+
145
+ # Custom attribute writer method with validation
146
+ # @param [Object] into Value to be assigned
147
+ def into=(into)
148
+ if into.nil?
149
+ fail ArgumentError, 'into cannot be nil'
150
+ end
151
+
152
+ @into = into
153
+ end
154
+
155
+ # Checks equality by comparing each attribute.
156
+ # @param [Object] Object to be compared
157
+ def ==(o)
158
+ return true if self.equal?(o)
159
+ self.class == o.class &&
160
+ into == o.into &&
161
+ fields == o.fields &&
162
+ keep == o.keep
163
+ end
164
+
165
+ # @see the `==` method
166
+ # @param [Object] Object to be compared
167
+ def eql?(o)
168
+ self == o
169
+ end
170
+
171
+ # Calculates hash code according to all attributes.
172
+ # @return [Integer] Hash code
173
+ def hash
174
+ [into, fields, keep].hash
175
+ end
176
+
177
+ # Builds the object from hash
178
+ # @param [Hash] attributes Model attributes in the form of hash
179
+ # @return [Object] Returns the model itself
180
+ def self.build_from_hash(attributes)
181
+ return nil unless attributes.is_a?(Hash)
182
+ attributes = attributes.transform_keys(&:to_sym)
183
+ # include attributes inherited from allOf parents (the nearest declaration wins)
184
+ map = acceptable_attribute_map
185
+ transformed_hash = {}
186
+ acceptable_openapi_types.each_pair do |key, type|
187
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
188
+ transformed_hash["#{key}"] = nil
189
+ elsif type =~ /\AArray<(.*)>/i
190
+ # check to ensure the input is an array given that the attribute
191
+ # is documented as an array but the input is not
192
+ if attributes[map[key]].is_a?(Array)
193
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
194
+ end
195
+ elsif !attributes[map[key]].nil?
196
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
197
+ end
198
+ end
199
+ new(transformed_hash)
200
+ end
201
+
202
+ # Returns the object in the form of hash
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_hash
205
+ hash = {}
206
+ # include attributes inherited from allOf parents (the nearest declaration wins)
207
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ if value.nil?
210
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
211
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
212
+ end
213
+
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ end
220
+
221
+ end
@@ -0,0 +1,279 @@
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
+ # Per field, whose value stays (`from` this customer, `into` the one that stays). Left out, the merge preview's suggestion.
18
+ class MergeOrganizationRequestFields < ApiModelBase
19
+ attr_accessor :name
20
+
21
+ attr_accessor :billing_email
22
+
23
+ attr_accessor :billing_country
24
+
25
+ attr_accessor :address
26
+
27
+ attr_accessor :tax_id
28
+
29
+ class EnumAttributeValidator
30
+ attr_reader :datatype
31
+ attr_reader :allowable_values
32
+
33
+ def initialize(datatype, allowable_values)
34
+ @allowable_values = allowable_values.map do |value|
35
+ case datatype.to_s
36
+ when /Integer/i
37
+ value.to_i
38
+ when /Float/i
39
+ value.to_f
40
+ else
41
+ value
42
+ end
43
+ end
44
+ end
45
+
46
+ def valid?(value)
47
+ !value || allowable_values.include?(value)
48
+ end
49
+ end
50
+
51
+ # Attribute mapping from ruby-style variable name to JSON key.
52
+ def self.attribute_map
53
+ {
54
+ :'name' => :'name',
55
+ :'billing_email' => :'billing_email',
56
+ :'billing_country' => :'billing_country',
57
+ :'address' => :'address',
58
+ :'tax_id' => :'tax_id'
59
+ }
60
+ end
61
+
62
+ # Returns attribute mapping this model knows about
63
+ def self.acceptable_attribute_map
64
+ attribute_map
65
+ end
66
+
67
+ # Returns all the JSON keys this model knows about
68
+ def self.acceptable_attributes
69
+ acceptable_attribute_map.values
70
+ end
71
+
72
+ # Attribute type mapping.
73
+ def self.openapi_types
74
+ {
75
+ :'name' => :'String',
76
+ :'billing_email' => :'String',
77
+ :'billing_country' => :'String',
78
+ :'address' => :'String',
79
+ :'tax_id' => :'String'
80
+ }
81
+ end
82
+
83
+ # List of attributes with nullable: true
84
+ def self.openapi_nullable
85
+ Set.new([
86
+ ])
87
+ end
88
+
89
+ # Returns attribute type mapping
90
+ def self.acceptable_openapi_types
91
+ openapi_types
92
+ end
93
+
94
+ # Returns the nullable attributes
95
+ def self.acceptable_openapi_nullable
96
+ openapi_nullable
97
+ end
98
+
99
+ # Initializes the object
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ def initialize(attributes = {})
102
+ if (!attributes.is_a?(Hash))
103
+ fail ArgumentError, "The input argument (attributes) must be a hash in `CboxBilling::MergeOrganizationRequestFields` initialize method"
104
+ end
105
+
106
+ # check to see if the attribute exists and convert string to symbol for hash key
107
+ acceptable_attribute_map = self.class.acceptable_attribute_map
108
+ attributes = attributes.each_with_object({}) { |(k, v), h|
109
+ if (!acceptable_attribute_map.key?(k.to_sym))
110
+ fail ArgumentError, "`#{k}` is not a valid attribute in `CboxBilling::MergeOrganizationRequestFields`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
111
+ end
112
+ h[k.to_sym] = v
113
+ }
114
+
115
+ if attributes.key?(:'name')
116
+ self.name = attributes[:'name']
117
+ end
118
+
119
+ if attributes.key?(:'billing_email')
120
+ self.billing_email = attributes[:'billing_email']
121
+ end
122
+
123
+ if attributes.key?(:'billing_country')
124
+ self.billing_country = attributes[:'billing_country']
125
+ end
126
+
127
+ if attributes.key?(:'address')
128
+ self.address = attributes[:'address']
129
+ end
130
+
131
+ if attributes.key?(:'tax_id')
132
+ self.tax_id = attributes[:'tax_id']
133
+ end
134
+ end
135
+
136
+ # Show invalid properties with the reasons. Usually used together with valid?
137
+ # @return Array for valid properties with the reasons
138
+ def list_invalid_properties
139
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
140
+ invalid_properties = Array.new
141
+ invalid_properties
142
+ end
143
+
144
+ # Check to see if the all the properties in the model are valid
145
+ # @return true if the model is valid
146
+ def valid?
147
+ warn '[DEPRECATED] the `valid?` method is obsolete'
148
+ name_validator = EnumAttributeValidator.new('String', ["from", "into"])
149
+ return false unless name_validator.valid?(@name)
150
+ billing_email_validator = EnumAttributeValidator.new('String', ["from", "into"])
151
+ return false unless billing_email_validator.valid?(@billing_email)
152
+ billing_country_validator = EnumAttributeValidator.new('String', ["from", "into"])
153
+ return false unless billing_country_validator.valid?(@billing_country)
154
+ address_validator = EnumAttributeValidator.new('String', ["from", "into"])
155
+ return false unless address_validator.valid?(@address)
156
+ tax_id_validator = EnumAttributeValidator.new('String', ["from", "into"])
157
+ return false unless tax_id_validator.valid?(@tax_id)
158
+ true
159
+ end
160
+
161
+ # Custom attribute writer method checking allowed values (enum).
162
+ # @param [Object] name Object to be assigned
163
+ def name=(name)
164
+ validator = EnumAttributeValidator.new('String', ["from", "into"])
165
+ unless validator.valid?(name)
166
+ fail ArgumentError, "invalid value for \"name\", must be one of #{validator.allowable_values}."
167
+ end
168
+ @name = name
169
+ end
170
+
171
+ # Custom attribute writer method checking allowed values (enum).
172
+ # @param [Object] billing_email Object to be assigned
173
+ def billing_email=(billing_email)
174
+ validator = EnumAttributeValidator.new('String', ["from", "into"])
175
+ unless validator.valid?(billing_email)
176
+ fail ArgumentError, "invalid value for \"billing_email\", must be one of #{validator.allowable_values}."
177
+ end
178
+ @billing_email = billing_email
179
+ end
180
+
181
+ # Custom attribute writer method checking allowed values (enum).
182
+ # @param [Object] billing_country Object to be assigned
183
+ def billing_country=(billing_country)
184
+ validator = EnumAttributeValidator.new('String', ["from", "into"])
185
+ unless validator.valid?(billing_country)
186
+ fail ArgumentError, "invalid value for \"billing_country\", must be one of #{validator.allowable_values}."
187
+ end
188
+ @billing_country = billing_country
189
+ end
190
+
191
+ # Custom attribute writer method checking allowed values (enum).
192
+ # @param [Object] address Object to be assigned
193
+ def address=(address)
194
+ validator = EnumAttributeValidator.new('String', ["from", "into"])
195
+ unless validator.valid?(address)
196
+ fail ArgumentError, "invalid value for \"address\", must be one of #{validator.allowable_values}."
197
+ end
198
+ @address = address
199
+ end
200
+
201
+ # Custom attribute writer method checking allowed values (enum).
202
+ # @param [Object] tax_id Object to be assigned
203
+ def tax_id=(tax_id)
204
+ validator = EnumAttributeValidator.new('String', ["from", "into"])
205
+ unless validator.valid?(tax_id)
206
+ fail ArgumentError, "invalid value for \"tax_id\", must be one of #{validator.allowable_values}."
207
+ end
208
+ @tax_id = tax_id
209
+ end
210
+
211
+ # Checks equality by comparing each attribute.
212
+ # @param [Object] Object to be compared
213
+ def ==(o)
214
+ return true if self.equal?(o)
215
+ self.class == o.class &&
216
+ name == o.name &&
217
+ billing_email == o.billing_email &&
218
+ billing_country == o.billing_country &&
219
+ address == o.address &&
220
+ tax_id == o.tax_id
221
+ end
222
+
223
+ # @see the `==` method
224
+ # @param [Object] Object to be compared
225
+ def eql?(o)
226
+ self == o
227
+ end
228
+
229
+ # Calculates hash code according to all attributes.
230
+ # @return [Integer] Hash code
231
+ def hash
232
+ [name, billing_email, billing_country, address, tax_id].hash
233
+ end
234
+
235
+ # Builds the object from hash
236
+ # @param [Hash] attributes Model attributes in the form of hash
237
+ # @return [Object] Returns the model itself
238
+ def self.build_from_hash(attributes)
239
+ return nil unless attributes.is_a?(Hash)
240
+ attributes = attributes.transform_keys(&:to_sym)
241
+ # include attributes inherited from allOf parents (the nearest declaration wins)
242
+ map = acceptable_attribute_map
243
+ transformed_hash = {}
244
+ acceptable_openapi_types.each_pair do |key, type|
245
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
246
+ transformed_hash["#{key}"] = nil
247
+ elsif type =~ /\AArray<(.*)>/i
248
+ # check to ensure the input is an array given that the attribute
249
+ # is documented as an array but the input is not
250
+ if attributes[map[key]].is_a?(Array)
251
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
252
+ end
253
+ elsif !attributes[map[key]].nil?
254
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
255
+ end
256
+ end
257
+ new(transformed_hash)
258
+ end
259
+
260
+ # Returns the object in the form of hash
261
+ # @return [Hash] Returns the object in the form of hash
262
+ def to_hash
263
+ hash = {}
264
+ # include attributes inherited from allOf parents (the nearest declaration wins)
265
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
266
+ value = self.send(attr)
267
+ if value.nil?
268
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
269
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
270
+ end
271
+
272
+ hash[param] = _to_hash(value)
273
+ end
274
+ hash
275
+ end
276
+
277
+ end
278
+
279
+ end