billabear 1.0.0 → 1.1.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.
- checksums.yaml +4 -4
- data/README.md +509 -364
- data/billabear.gemspec +4 -4
- data/docs/Address.md +1 -1
- data/docs/BillingAdmin.md +1 -1
- data/docs/CheckoutApi.md +6 -6
- data/docs/CheckoutBody.md +1 -1
- data/docs/CheckoutItems.md +1 -1
- data/docs/CheckoutSubscriptions.md +1 -1
- data/docs/Cost.md +8 -0
- data/docs/Customer.md +3 -1
- data/docs/CustomerIdUasgelimitBody.md +8 -0
- data/docs/CustomersApi.md +319 -101
- data/docs/Error.md +1 -1
- data/docs/Event.md +11 -0
- data/docs/Feature.md +1 -1
- data/docs/FrontendToken.md +1 -1
- data/docs/InlineResponse200.md +1 -1
- data/docs/InlineResponse2001.md +3 -4
- data/docs/InlineResponse20010.md +2 -2
- data/docs/InlineResponse20011.md +4 -2
- data/docs/InlineResponse20012.md +4 -3
- data/docs/InlineResponse20013.md +7 -0
- data/docs/InlineResponse20014.md +8 -0
- data/docs/InlineResponse2002.md +4 -4
- data/docs/InlineResponse2003.md +2 -2
- data/docs/InlineResponse2004.md +2 -2
- data/docs/InlineResponse2005.md +2 -2
- data/docs/InlineResponse2006.md +2 -2
- data/docs/InlineResponse2007.md +2 -2
- data/docs/InlineResponse2008.md +2 -2
- data/docs/InlineResponse2009.md +2 -2
- data/docs/{InlineResponse2007Data.md → InlineResponse2009Data.md} +2 -2
- data/docs/{InlineResponse2007Receipts.md → InlineResponse2009Receipts.md} +1 -1
- data/docs/InlineResponse201.md +1 -1
- data/docs/InlineResponse201Lines.md +1 -1
- data/docs/InlineResponse400.md +1 -1
- data/docs/Invoice.md +1 -1
- data/docs/InvoiceLines.md +1 -1
- data/docs/InvoicesApi.md +17 -17
- data/docs/IssueRefundPayment.md +1 -1
- data/docs/Limit.md +1 -1
- data/docs/Metric.md +12 -0
- data/docs/MetricCost.md +10 -0
- data/docs/MetricFilter.md +11 -0
- data/docs/PaymentDetails.md +1 -1
- data/docs/PaymentDetailsApi.md +48 -52
- data/docs/PaymentsApi.md +41 -42
- data/docs/Price.md +2 -1
- data/docs/PricesApi.md +15 -16
- data/docs/Product.md +1 -1
- data/docs/ProductTaxType.md +1 -1
- data/docs/ProductsApi.md +23 -24
- data/docs/ReceiptApi.md +5 -5
- data/docs/Refund.md +1 -1
- data/docs/RefundsApi.md +17 -17
- data/docs/SeatsAddBody.md +1 -1
- data/docs/SeatsRemoveBody.md +1 -1
- data/docs/Subscription.md +2 -1
- data/docs/SubscriptionIdCancelBody.md +1 -1
- data/docs/SubscriptionIdExtendBody.md +1 -1
- data/docs/SubscriptionIdPlanBody.md +2 -2
- data/docs/SubscriptionIdPriceBody.md +1 -1
- data/docs/SubscriptionPlan.md +1 -1
- data/docs/SubscriptionStartBody.md +2 -1
- data/docs/SubscriptionTrialBody.md +1 -1
- data/docs/SubscriptionsApi.md +78 -79
- data/docs/UsageApi.md +279 -0
- data/docs/UsageLimit.md +9 -0
- data/docs/VoucherCode.md +1 -1
- data/git_push.sh +2 -2
- data/lib/{swagger_client → billabear}/api/checkout_api.rb +3 -3
- data/lib/{swagger_client → billabear}/api/customers_api.rb +284 -45
- data/lib/{swagger_client → billabear}/api/invoices_api.rb +9 -9
- data/lib/{swagger_client → billabear}/api/payment_details_api.rb +26 -26
- data/lib/{swagger_client → billabear}/api/payments_api.rb +20 -20
- data/lib/{swagger_client → billabear}/api/prices_api.rb +11 -11
- data/lib/{swagger_client → billabear}/api/products_api.rb +11 -11
- data/lib/{swagger_client → billabear}/api/receipt_api.rb +3 -3
- data/lib/{swagger_client → billabear}/api/refunds_api.rb +9 -9
- data/lib/{swagger_client → billabear}/api/subscriptions_api.rb +29 -29
- data/lib/billabear/api/usage_api.rb +314 -0
- data/lib/{swagger_client → billabear}/api_client.rb +4 -4
- data/lib/{swagger_client → billabear}/api_error.rb +3 -3
- data/lib/{swagger_client → billabear}/configuration.rb +3 -3
- data/lib/{swagger_client → billabear}/models/address.rb +6 -6
- data/lib/{swagger_client → billabear}/models/billing_admin.rb +6 -6
- data/lib/{swagger_client → billabear}/models/checkout_body.rb +6 -6
- data/lib/{swagger_client → billabear}/models/checkout_items.rb +6 -6
- data/lib/{swagger_client → billabear}/models/checkout_subscriptions.rb +6 -6
- data/lib/billabear/models/cost.rb +215 -0
- data/lib/{swagger_client → billabear}/models/customer.rb +45 -11
- data/lib/billabear/models/customer_id_uasgelimit_body.rb +259 -0
- data/lib/{swagger_client → billabear}/models/error.rb +6 -6
- data/lib/billabear/models/event.rb +262 -0
- data/lib/{swagger_client → billabear}/models/feature.rb +6 -6
- data/lib/{swagger_client → billabear}/models/frontend_token.rb +6 -6
- data/lib/{swagger_client → billabear}/models/inline_response_200.rb +6 -6
- data/lib/billabear/models/inline_response_200_1.rb +217 -0
- data/lib/{swagger_client → billabear}/models/inline_response_200_10.rb +6 -6
- data/lib/{swagger_client/models/inline_response_200_2.rb → billabear/models/inline_response_200_11.rb} +7 -7
- data/lib/billabear/models/inline_response_200_12.rb +226 -0
- data/lib/{swagger_client/models/inline_response_200_11.rb → billabear/models/inline_response_200_13.rb} +7 -7
- data/lib/{swagger_client/models/inline_response_200_12.rb → billabear/models/inline_response_200_14.rb} +7 -7
- data/lib/{swagger_client/models/inline_response_200_1.rb → billabear/models/inline_response_200_2.rb} +7 -7
- data/lib/{swagger_client → billabear}/models/inline_response_200_3.rb +6 -6
- data/lib/{swagger_client → billabear}/models/inline_response_200_4.rb +6 -6
- data/lib/{swagger_client → billabear}/models/inline_response_200_5.rb +6 -6
- data/lib/{swagger_client → billabear}/models/inline_response_200_6.rb +6 -6
- data/lib/{swagger_client → billabear}/models/inline_response_200_7.rb +6 -6
- data/lib/{swagger_client → billabear}/models/inline_response_200_8.rb +6 -6
- data/lib/{swagger_client → billabear}/models/inline_response_200_9.rb +6 -6
- data/lib/{swagger_client/models/inline_response_200_7_data.rb → billabear/models/inline_response_200_9_data.rb} +7 -7
- data/lib/{swagger_client/models/inline_response_200_7_receipts.rb → billabear/models/inline_response_200_9_receipts.rb} +7 -7
- data/lib/{swagger_client → billabear}/models/inline_response_201.rb +6 -6
- data/lib/{swagger_client → billabear}/models/inline_response_201_lines.rb +6 -6
- data/lib/{swagger_client → billabear}/models/inline_response_400.rb +6 -6
- data/lib/{swagger_client → billabear}/models/invoice.rb +6 -6
- data/lib/{swagger_client → billabear}/models/invoice_lines.rb +6 -6
- data/lib/{swagger_client → billabear}/models/issue_refund_payment.rb +6 -6
- data/lib/{swagger_client → billabear}/models/limit.rb +6 -6
- data/lib/billabear/models/metric.rb +288 -0
- data/lib/billabear/models/metric_cost.rb +234 -0
- data/lib/billabear/models/metric_filter.rb +276 -0
- data/lib/{swagger_client → billabear}/models/payment_details.rb +6 -6
- data/lib/{swagger_client → billabear}/models/price.rb +20 -11
- data/lib/{swagger_client → billabear}/models/product.rb +6 -6
- data/lib/{swagger_client → billabear}/models/product_tax_type.rb +6 -6
- data/lib/{swagger_client → billabear}/models/refund.rb +6 -6
- data/lib/{swagger_client → billabear}/models/seats_add_body.rb +6 -6
- data/lib/{swagger_client → billabear}/models/seats_remove_body.rb +6 -6
- data/lib/{swagger_client → billabear}/models/subscription.rb +16 -7
- data/lib/{swagger_client → billabear}/models/subscription_id_cancel_body.rb +6 -6
- data/lib/{swagger_client → billabear}/models/subscription_id_extend_body.rb +6 -6
- data/lib/{swagger_client → billabear}/models/subscription_id_plan_body.rb +11 -6
- data/lib/{swagger_client → billabear}/models/subscription_id_price_body.rb +6 -6
- data/lib/{swagger_client → billabear}/models/subscription_plan.rb +6 -6
- data/lib/{swagger_client → billabear}/models/subscription_start_body.rb +20 -10
- data/lib/{swagger_client → billabear}/models/subscription_trial_body.rb +6 -6
- data/lib/billabear/models/usage_limit.rb +258 -0
- data/lib/{swagger_client → billabear}/models/voucher_code.rb +6 -6
- data/lib/{swagger_client → billabear}/version.rb +4 -4
- data/lib/billabear.rb +105 -0
- data/spec/api/checkout_api_spec.rb +5 -5
- data/spec/api/customers_api_spec.rb +68 -17
- data/spec/api/invoices_api_spec.rb +7 -7
- data/spec/api/payment_details_api_spec.rb +10 -10
- data/spec/api/payments_api_spec.rb +10 -10
- data/spec/api/prices_api_spec.rb +7 -7
- data/spec/api/products_api_spec.rb +7 -7
- data/spec/api/receipt_api_spec.rb +5 -5
- data/spec/api/refunds_api_spec.rb +7 -7
- data/spec/api/subscriptions_api_spec.rb +13 -13
- data/spec/api/usage_api_spec.rb +96 -0
- data/spec/api_client_spec.rb +31 -31
- data/spec/configuration_spec.rb +5 -5
- data/spec/models/address_spec.rb +5 -5
- data/spec/models/billing_admin_spec.rb +5 -5
- data/spec/models/checkout_body_spec.rb +5 -5
- data/spec/models/checkout_items_spec.rb +5 -5
- data/spec/models/checkout_subscriptions_spec.rb +5 -5
- data/spec/models/cost_spec.rb +46 -0
- data/spec/models/customer_id_uasgelimit_body_spec.rb +50 -0
- data/spec/models/customer_spec.rb +21 -5
- data/spec/models/error_spec.rb +5 -5
- data/spec/models/event_spec.rb +64 -0
- data/spec/models/feature_spec.rb +5 -5
- data/spec/models/frontend_token_spec.rb +5 -5
- data/spec/models/inline_response_200_10_spec.rb +5 -5
- data/spec/models/inline_response_200_11_spec.rb +18 -6
- data/spec/models/inline_response_200_12_spec.rb +13 -11
- data/spec/models/inline_response_200_13_spec.rb +40 -0
- data/spec/models/inline_response_200_14_spec.rb +50 -0
- data/spec/models/inline_response_200_1_spec.rb +7 -13
- data/spec/models/inline_response_200_2_spec.rb +8 -8
- data/spec/models/inline_response_200_3_spec.rb +5 -5
- data/spec/models/inline_response_200_4_spec.rb +5 -5
- data/spec/models/inline_response_200_5_spec.rb +5 -5
- data/spec/models/inline_response_200_6_spec.rb +5 -5
- data/spec/models/inline_response_200_7_spec.rb +5 -5
- data/spec/models/inline_response_200_8_spec.rb +5 -5
- data/spec/models/{inline_response_200_7_data_spec.rb → inline_response_200_9_data_spec.rb} +8 -8
- data/spec/models/{inline_response_200_7_receipts_spec.rb → inline_response_200_9_receipts_spec.rb} +8 -8
- data/spec/models/inline_response_200_9_spec.rb +5 -5
- data/spec/models/inline_response_200_spec.rb +5 -5
- data/spec/models/inline_response_201_lines_spec.rb +5 -5
- data/spec/models/inline_response_201_spec.rb +5 -5
- data/spec/models/inline_response_400_spec.rb +5 -5
- data/spec/models/invoice_lines_spec.rb +5 -5
- data/spec/models/invoice_spec.rb +5 -5
- data/spec/models/issue_refund_payment_spec.rb +5 -5
- data/spec/models/limit_spec.rb +5 -5
- data/spec/models/metric_cost_spec.rb +58 -0
- data/spec/models/metric_filter_spec.rb +68 -0
- data/spec/models/metric_spec.rb +74 -0
- data/spec/models/payment_details_spec.rb +5 -5
- data/spec/models/price_spec.rb +11 -5
- data/spec/models/product_spec.rb +5 -5
- data/spec/models/product_tax_type_spec.rb +5 -5
- data/spec/models/refund_spec.rb +5 -5
- data/spec/models/seats_add_body_spec.rb +5 -5
- data/spec/models/seats_remove_body_spec.rb +5 -5
- data/spec/models/subscription_id_cancel_body_spec.rb +5 -5
- data/spec/models/subscription_id_extend_body_spec.rb +5 -5
- data/spec/models/subscription_id_plan_body_spec.rb +5 -5
- data/spec/models/subscription_id_price_body_spec.rb +5 -5
- data/spec/models/subscription_plan_spec.rb +5 -5
- data/spec/models/subscription_spec.rb +11 -5
- data/spec/models/subscription_start_body_spec.rb +11 -5
- data/spec/models/subscription_trial_body_spec.rb +5 -5
- data/spec/models/usage_limit_spec.rb +56 -0
- data/spec/models/voucher_code_spec.rb +5 -5
- data/spec/spec_helper.rb +3 -3
- metadata +110 -70
- data/lib/swagger_client.rb +0 -95
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
|
|
4
4
|
#The REST API provided by BillaBear
|
|
5
5
|
|
|
6
|
-
OpenAPI spec version: 1.
|
|
6
|
+
OpenAPI spec version: 1.1.0
|
|
7
7
|
Contact: support@billabear.com
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
-
Swagger Codegen version: 3.0.
|
|
9
|
+
Swagger Codegen version: 3.0.66
|
|
10
10
|
=end
|
|
11
11
|
|
|
12
12
|
require 'date'
|
|
13
13
|
|
|
14
|
-
module
|
|
14
|
+
module Billabear
|
|
15
15
|
class BillingAdmin
|
|
16
16
|
attr_accessor :id
|
|
17
17
|
|
|
@@ -43,13 +43,13 @@ module SwaggerClient
|
|
|
43
43
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
44
44
|
def initialize(attributes = {})
|
|
45
45
|
if (!attributes.is_a?(Hash))
|
|
46
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
|
46
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Billabear::BillingAdmin` initialize method"
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
50
50
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
51
51
|
if (!self.class.attribute_map.key?(k.to_sym))
|
|
52
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
|
52
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Billabear::BillingAdmin`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
53
53
|
end
|
|
54
54
|
h[k.to_sym] = v
|
|
55
55
|
}
|
|
@@ -163,7 +163,7 @@ module SwaggerClient
|
|
|
163
163
|
end
|
|
164
164
|
end
|
|
165
165
|
else # model
|
|
166
|
-
|
|
166
|
+
Billabear.const_get(type).build_from_hash(value)
|
|
167
167
|
end
|
|
168
168
|
end
|
|
169
169
|
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
|
|
4
4
|
#The REST API provided by BillaBear
|
|
5
5
|
|
|
6
|
-
OpenAPI spec version: 1.
|
|
6
|
+
OpenAPI spec version: 1.1.0
|
|
7
7
|
Contact: support@billabear.com
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
-
Swagger Codegen version: 3.0.
|
|
9
|
+
Swagger Codegen version: 3.0.66
|
|
10
10
|
=end
|
|
11
11
|
|
|
12
12
|
require 'date'
|
|
13
13
|
|
|
14
|
-
module
|
|
14
|
+
module Billabear
|
|
15
15
|
class CheckoutBody
|
|
16
16
|
attr_accessor :name
|
|
17
17
|
|
|
@@ -59,13 +59,13 @@ module SwaggerClient
|
|
|
59
59
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
60
60
|
def initialize(attributes = {})
|
|
61
61
|
if (!attributes.is_a?(Hash))
|
|
62
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
|
62
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Billabear::CheckoutBody` initialize method"
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
66
66
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
67
67
|
if (!self.class.attribute_map.key?(k.to_sym))
|
|
68
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Billabear::CheckoutBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
69
69
|
end
|
|
70
70
|
h[k.to_sym] = v
|
|
71
71
|
}
|
|
@@ -213,7 +213,7 @@ module SwaggerClient
|
|
|
213
213
|
end
|
|
214
214
|
end
|
|
215
215
|
else # model
|
|
216
|
-
|
|
216
|
+
Billabear.const_get(type).build_from_hash(value)
|
|
217
217
|
end
|
|
218
218
|
end
|
|
219
219
|
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
|
|
4
4
|
#The REST API provided by BillaBear
|
|
5
5
|
|
|
6
|
-
OpenAPI spec version: 1.
|
|
6
|
+
OpenAPI spec version: 1.1.0
|
|
7
7
|
Contact: support@billabear.com
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
-
Swagger Codegen version: 3.0.
|
|
9
|
+
Swagger Codegen version: 3.0.66
|
|
10
10
|
=end
|
|
11
11
|
|
|
12
12
|
require 'date'
|
|
13
13
|
|
|
14
|
-
module
|
|
14
|
+
module Billabear
|
|
15
15
|
class CheckoutItems
|
|
16
16
|
attr_accessor :description
|
|
17
17
|
|
|
@@ -55,13 +55,13 @@ module SwaggerClient
|
|
|
55
55
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
56
56
|
def initialize(attributes = {})
|
|
57
57
|
if (!attributes.is_a?(Hash))
|
|
58
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Billabear::CheckoutItems` initialize method"
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
62
62
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
63
63
|
if (!self.class.attribute_map.key?(k.to_sym))
|
|
64
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
|
64
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Billabear::CheckoutItems`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
65
65
|
end
|
|
66
66
|
h[k.to_sym] = v
|
|
67
67
|
}
|
|
@@ -190,7 +190,7 @@ module SwaggerClient
|
|
|
190
190
|
end
|
|
191
191
|
end
|
|
192
192
|
else # model
|
|
193
|
-
|
|
193
|
+
Billabear.const_get(type).build_from_hash(value)
|
|
194
194
|
end
|
|
195
195
|
end
|
|
196
196
|
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
|
|
4
4
|
#The REST API provided by BillaBear
|
|
5
5
|
|
|
6
|
-
OpenAPI spec version: 1.
|
|
6
|
+
OpenAPI spec version: 1.1.0
|
|
7
7
|
Contact: support@billabear.com
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
-
Swagger Codegen version: 3.0.
|
|
9
|
+
Swagger Codegen version: 3.0.66
|
|
10
10
|
=end
|
|
11
11
|
|
|
12
12
|
require 'date'
|
|
13
13
|
|
|
14
|
-
module
|
|
14
|
+
module Billabear
|
|
15
15
|
class CheckoutSubscriptions
|
|
16
16
|
attr_accessor :plan
|
|
17
17
|
|
|
@@ -47,13 +47,13 @@ module SwaggerClient
|
|
|
47
47
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
48
48
|
def initialize(attributes = {})
|
|
49
49
|
if (!attributes.is_a?(Hash))
|
|
50
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Billabear::CheckoutSubscriptions` initialize method"
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
54
54
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
55
55
|
if (!self.class.attribute_map.key?(k.to_sym))
|
|
56
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Billabear::CheckoutSubscriptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
57
57
|
end
|
|
58
58
|
h[k.to_sym] = v
|
|
59
59
|
}
|
|
@@ -172,7 +172,7 @@ module SwaggerClient
|
|
|
172
172
|
end
|
|
173
173
|
end
|
|
174
174
|
else # model
|
|
175
|
-
|
|
175
|
+
Billabear.const_get(type).build_from_hash(value)
|
|
176
176
|
end
|
|
177
177
|
end
|
|
178
178
|
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#BillaBear
|
|
3
|
+
|
|
4
|
+
#The REST API provided by BillaBear
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 1.1.0
|
|
7
|
+
Contact: support@billabear.com
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 3.0.66
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
require 'date'
|
|
13
|
+
|
|
14
|
+
module Billabear
|
|
15
|
+
class Cost
|
|
16
|
+
attr_accessor :amount
|
|
17
|
+
|
|
18
|
+
attr_accessor :currency
|
|
19
|
+
|
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
|
+
def self.attribute_map
|
|
22
|
+
{
|
|
23
|
+
:'amount' => :'amount',
|
|
24
|
+
:'currency' => :'currency'
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Attribute type mapping.
|
|
29
|
+
def self.openapi_types
|
|
30
|
+
{
|
|
31
|
+
:'amount' => :'Object',
|
|
32
|
+
:'currency' => :'Object'
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# List of attributes with nullable: true
|
|
37
|
+
def self.openapi_nullable
|
|
38
|
+
Set.new([
|
|
39
|
+
])
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Initializes the object
|
|
43
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
44
|
+
def initialize(attributes = {})
|
|
45
|
+
if (!attributes.is_a?(Hash))
|
|
46
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Billabear::Cost` initialize method"
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
50
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
51
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
52
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Billabear::Cost`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
53
|
+
end
|
|
54
|
+
h[k.to_sym] = v
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if attributes.key?(:'amount')
|
|
58
|
+
self.amount = attributes[:'amount']
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
if attributes.key?(:'currency')
|
|
62
|
+
self.currency = attributes[:'currency']
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
67
|
+
# @return Array for valid properties with the reasons
|
|
68
|
+
def list_invalid_properties
|
|
69
|
+
invalid_properties = Array.new
|
|
70
|
+
invalid_properties
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Check to see if the all the properties in the model are valid
|
|
74
|
+
# @return true if the model is valid
|
|
75
|
+
def valid?
|
|
76
|
+
true
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Checks equality by comparing each attribute.
|
|
80
|
+
# @param [Object] Object to be compared
|
|
81
|
+
def ==(o)
|
|
82
|
+
return true if self.equal?(o)
|
|
83
|
+
self.class == o.class &&
|
|
84
|
+
amount == o.amount &&
|
|
85
|
+
currency == o.currency
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# @see the `==` method
|
|
89
|
+
# @param [Object] Object to be compared
|
|
90
|
+
def eql?(o)
|
|
91
|
+
self == o
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Calculates hash code according to all attributes.
|
|
95
|
+
# @return [Integer] Hash code
|
|
96
|
+
def hash
|
|
97
|
+
[amount, currency].hash
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Builds the object from hash
|
|
101
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
102
|
+
# @return [Object] Returns the model itself
|
|
103
|
+
def self.build_from_hash(attributes)
|
|
104
|
+
new.build_from_hash(attributes)
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Builds the object from hash
|
|
108
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
109
|
+
# @return [Object] Returns the model itself
|
|
110
|
+
def build_from_hash(attributes)
|
|
111
|
+
return nil unless attributes.is_a?(Hash)
|
|
112
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
113
|
+
if type =~ /\AArray<(.*)>/i
|
|
114
|
+
# check to ensure the input is an array given that the attribute
|
|
115
|
+
# is documented as an array but the input is not
|
|
116
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
117
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
118
|
+
end
|
|
119
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
120
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
121
|
+
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
122
|
+
self.send("#{key}=", nil)
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
self
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Deserializes the data based on type
|
|
130
|
+
# @param string type Data type
|
|
131
|
+
# @param string value Value to be deserialized
|
|
132
|
+
# @return [Object] Deserialized data
|
|
133
|
+
def _deserialize(type, value)
|
|
134
|
+
case type.to_sym
|
|
135
|
+
when :DateTime
|
|
136
|
+
DateTime.parse(value)
|
|
137
|
+
when :Date
|
|
138
|
+
Date.parse(value)
|
|
139
|
+
when :String
|
|
140
|
+
value.to_s
|
|
141
|
+
when :Integer
|
|
142
|
+
value.to_i
|
|
143
|
+
when :Float
|
|
144
|
+
value.to_f
|
|
145
|
+
when :Boolean
|
|
146
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
147
|
+
true
|
|
148
|
+
else
|
|
149
|
+
false
|
|
150
|
+
end
|
|
151
|
+
when :Object
|
|
152
|
+
# generic object (usually a Hash), return directly
|
|
153
|
+
value
|
|
154
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
155
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
156
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
157
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
158
|
+
k_type = Regexp.last_match[:k_type]
|
|
159
|
+
v_type = Regexp.last_match[:v_type]
|
|
160
|
+
{}.tap do |hash|
|
|
161
|
+
value.each do |k, v|
|
|
162
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
else # model
|
|
166
|
+
Billabear.const_get(type).build_from_hash(value)
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Returns the string representation of the object
|
|
171
|
+
# @return [String] String presentation of the object
|
|
172
|
+
def to_s
|
|
173
|
+
to_hash.to_s
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
177
|
+
# @return [Hash] Returns the object in the form of hash
|
|
178
|
+
def to_body
|
|
179
|
+
to_hash
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Returns the object in the form of hash
|
|
183
|
+
# @return [Hash] Returns the object in the form of hash
|
|
184
|
+
def to_hash
|
|
185
|
+
hash = {}
|
|
186
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
187
|
+
value = self.send(attr)
|
|
188
|
+
if value.nil?
|
|
189
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
190
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
hash[param] = _to_hash(value)
|
|
194
|
+
end
|
|
195
|
+
hash
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# Outputs non-array value in the form of hash
|
|
199
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
200
|
+
# @param [Object] value Any valid value
|
|
201
|
+
# @return [Hash] Returns the value in the form of hash
|
|
202
|
+
def _to_hash(value)
|
|
203
|
+
if value.is_a?(Array)
|
|
204
|
+
value.compact.map { |v| _to_hash(v) }
|
|
205
|
+
elsif value.is_a?(Hash)
|
|
206
|
+
{}.tap do |hash|
|
|
207
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
208
|
+
end
|
|
209
|
+
elsif value.respond_to? :to_hash
|
|
210
|
+
value.to_hash
|
|
211
|
+
else
|
|
212
|
+
value
|
|
213
|
+
end
|
|
214
|
+
end end
|
|
215
|
+
end
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
|
|
4
4
|
#The REST API provided by BillaBear
|
|
5
5
|
|
|
6
|
-
OpenAPI spec version: 1.
|
|
6
|
+
OpenAPI spec version: 1.1.0
|
|
7
7
|
Contact: support@billabear.com
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
-
Swagger Codegen version: 3.0.
|
|
9
|
+
Swagger Codegen version: 3.0.66
|
|
10
10
|
=end
|
|
11
11
|
|
|
12
12
|
require 'date'
|
|
13
13
|
|
|
14
|
-
module
|
|
14
|
+
module Billabear
|
|
15
15
|
class Customer
|
|
16
16
|
attr_accessor :id
|
|
17
17
|
|
|
@@ -44,6 +44,12 @@ module SwaggerClient
|
|
|
44
44
|
# Defaults to 'default' if not sent.
|
|
45
45
|
attr_accessor :brand
|
|
46
46
|
|
|
47
|
+
# Choice between 'pdf' and 'xrechnung'. <strong>Since 2024.02.01</strong>
|
|
48
|
+
attr_accessor :invoice_format
|
|
49
|
+
|
|
50
|
+
# If the customer has opted in for marketing
|
|
51
|
+
attr_accessor :marketing_opt_in
|
|
52
|
+
|
|
47
53
|
class EnumAttributeValidator
|
|
48
54
|
attr_reader :datatype
|
|
49
55
|
attr_reader :allowable_values
|
|
@@ -80,7 +86,9 @@ module SwaggerClient
|
|
|
80
86
|
:'external_reference' => :'external_reference',
|
|
81
87
|
:'address' => :'address',
|
|
82
88
|
:'locale' => :'locale',
|
|
83
|
-
:'brand' => :'brand'
|
|
89
|
+
:'brand' => :'brand',
|
|
90
|
+
:'invoice_format' => :'invoice_format',
|
|
91
|
+
:'marketing_opt_in' => :'marketing_opt_in'
|
|
84
92
|
}
|
|
85
93
|
end
|
|
86
94
|
|
|
@@ -98,7 +106,9 @@ module SwaggerClient
|
|
|
98
106
|
:'external_reference' => :'Object',
|
|
99
107
|
:'address' => :'Object',
|
|
100
108
|
:'locale' => :'Object',
|
|
101
|
-
:'brand' => :'Object'
|
|
109
|
+
:'brand' => :'Object',
|
|
110
|
+
:'invoice_format' => :'Object',
|
|
111
|
+
:'marketing_opt_in' => :'Object'
|
|
102
112
|
}
|
|
103
113
|
end
|
|
104
114
|
|
|
@@ -111,7 +121,9 @@ module SwaggerClient
|
|
|
111
121
|
:'billing_type',
|
|
112
122
|
:'type',
|
|
113
123
|
:'locale',
|
|
114
|
-
:'brand'
|
|
124
|
+
:'brand',
|
|
125
|
+
:'invoice_format',
|
|
126
|
+
:'marketing_opt_in'
|
|
115
127
|
])
|
|
116
128
|
end
|
|
117
129
|
|
|
@@ -119,13 +131,13 @@ module SwaggerClient
|
|
|
119
131
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
120
132
|
def initialize(attributes = {})
|
|
121
133
|
if (!attributes.is_a?(Hash))
|
|
122
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
|
134
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Billabear::Customer` initialize method"
|
|
123
135
|
end
|
|
124
136
|
|
|
125
137
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
126
138
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
127
139
|
if (!self.class.attribute_map.key?(k.to_sym))
|
|
128
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
|
140
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Billabear::Customer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
129
141
|
end
|
|
130
142
|
h[k.to_sym] = v
|
|
131
143
|
}
|
|
@@ -177,6 +189,14 @@ module SwaggerClient
|
|
|
177
189
|
if attributes.key?(:'brand')
|
|
178
190
|
self.brand = attributes[:'brand']
|
|
179
191
|
end
|
|
192
|
+
|
|
193
|
+
if attributes.key?(:'invoice_format')
|
|
194
|
+
self.invoice_format = attributes[:'invoice_format']
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
if attributes.key?(:'marketing_opt_in')
|
|
198
|
+
self.marketing_opt_in = attributes[:'marketing_opt_in']
|
|
199
|
+
end
|
|
180
200
|
end
|
|
181
201
|
|
|
182
202
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -198,6 +218,8 @@ module SwaggerClient
|
|
|
198
218
|
return false unless billing_type_validator.valid?(@billing_type)
|
|
199
219
|
type_validator = EnumAttributeValidator.new('Object', ['individual', 'business'])
|
|
200
220
|
return false unless type_validator.valid?(@type)
|
|
221
|
+
invoice_format_validator = EnumAttributeValidator.new('Object', ['pdf', 'xrechnung'])
|
|
222
|
+
return false unless invoice_format_validator.valid?(@invoice_format)
|
|
201
223
|
true
|
|
202
224
|
end
|
|
203
225
|
|
|
@@ -221,6 +243,16 @@ module SwaggerClient
|
|
|
221
243
|
@type = type
|
|
222
244
|
end
|
|
223
245
|
|
|
246
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
247
|
+
# @param [Object] invoice_format Object to be assigned
|
|
248
|
+
def invoice_format=(invoice_format)
|
|
249
|
+
validator = EnumAttributeValidator.new('Object', ['pdf', 'xrechnung'])
|
|
250
|
+
unless validator.valid?(invoice_format)
|
|
251
|
+
fail ArgumentError, "invalid value for \"invoice_format\", must be one of #{validator.allowable_values}."
|
|
252
|
+
end
|
|
253
|
+
@invoice_format = invoice_format
|
|
254
|
+
end
|
|
255
|
+
|
|
224
256
|
# Checks equality by comparing each attribute.
|
|
225
257
|
# @param [Object] Object to be compared
|
|
226
258
|
def ==(o)
|
|
@@ -237,7 +269,9 @@ module SwaggerClient
|
|
|
237
269
|
external_reference == o.external_reference &&
|
|
238
270
|
address == o.address &&
|
|
239
271
|
locale == o.locale &&
|
|
240
|
-
brand == o.brand
|
|
272
|
+
brand == o.brand &&
|
|
273
|
+
invoice_format == o.invoice_format &&
|
|
274
|
+
marketing_opt_in == o.marketing_opt_in
|
|
241
275
|
end
|
|
242
276
|
|
|
243
277
|
# @see the `==` method
|
|
@@ -249,7 +283,7 @@ module SwaggerClient
|
|
|
249
283
|
# Calculates hash code according to all attributes.
|
|
250
284
|
# @return [Integer] Hash code
|
|
251
285
|
def hash
|
|
252
|
-
[id, email, tax_number, standard_tax_rate, digital_tax_rate, billing_type, type, reference, external_reference, address, locale, brand].hash
|
|
286
|
+
[id, email, tax_number, standard_tax_rate, digital_tax_rate, billing_type, type, reference, external_reference, address, locale, brand, invoice_format, marketing_opt_in].hash
|
|
253
287
|
end
|
|
254
288
|
|
|
255
289
|
# Builds the object from hash
|
|
@@ -318,7 +352,7 @@ module SwaggerClient
|
|
|
318
352
|
end
|
|
319
353
|
end
|
|
320
354
|
else # model
|
|
321
|
-
|
|
355
|
+
Billabear.const_get(type).build_from_hash(value)
|
|
322
356
|
end
|
|
323
357
|
end
|
|
324
358
|
|