lago_ruby 0.51.0.pre.beta → 0.52.0.pre.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -4
- data/docs/AddOnCreateInputAddOn.md +1 -1
- data/docs/AnalyticsApi.md +299 -0
- data/docs/CreditNoteItemObjectFee.md +4 -4
- data/docs/CustomerChargeUsageObjectCharge.md +3 -1
- data/docs/CustomersApi.md +70 -0
- data/docs/FeeObject.md +4 -4
- data/docs/GenerateCustomerCheckoutURL200Response.md +24 -0
- data/docs/GrossRevenueObject.md +22 -0
- data/docs/GrossRevenues.md +18 -0
- data/docs/InvoicedUsageObject.md +24 -0
- data/docs/InvoicedUsages.md +18 -0
- data/docs/MrrObject.md +22 -0
- data/docs/Mrrs.md +18 -0
- data/docs/OrganizationObject.md +2 -0
- data/docs/OrganizationUpdateInputOrganization.md +2 -0
- data/docs/OutstandingInvoiceObject.md +26 -0
- data/docs/OutstandingInvoices.md +18 -0
- data/docs/PlanOverridesObjectChargesInner.md +2 -0
- data/lago_ruby.gemspec +1 -1
- data/lib/lago_ruby/api/add_ons_api.rb +1 -1
- data/lib/lago_ruby/api/analytics_api.rb +268 -0
- data/lib/lago_ruby/api/billable_metrics_api.rb +1 -1
- data/lib/lago_ruby/api/coupons_api.rb +1 -1
- data/lib/lago_ruby/api/credit_notes_api.rb +1 -1
- data/lib/lago_ruby/api/customers_api.rb +64 -1
- data/lib/lago_ruby/api/events_api.rb +1 -1
- data/lib/lago_ruby/api/fees_api.rb +1 -1
- data/lib/lago_ruby/api/invoices_api.rb +1 -1
- data/lib/lago_ruby/api/organizations_api.rb +1 -1
- data/lib/lago_ruby/api/plans_api.rb +1 -1
- data/lib/lago_ruby/api/subscriptions_api.rb +1 -1
- data/lib/lago_ruby/api/taxes_api.rb +1 -1
- data/lib/lago_ruby/api/wallets_api.rb +1 -1
- data/lib/lago_ruby/api/webhook_endpoints_api.rb +1 -1
- data/lib/lago_ruby/api/webhooks_api.rb +1 -1
- data/lib/lago_ruby/api_client.rb +1 -1
- data/lib/lago_ruby/api_error.rb +1 -1
- data/lib/lago_ruby/configuration.rb +1 -1
- data/lib/lago_ruby/models/add_on.rb +1 -1
- data/lib/lago_ruby/models/add_on_base_input.rb +1 -1
- data/lib/lago_ruby/models/add_on_create_input.rb +1 -1
- data/lib/lago_ruby/models/add_on_create_input_add_on.rb +1 -1
- data/lib/lago_ruby/models/add_on_object.rb +1 -1
- data/lib/lago_ruby/models/add_on_update_input.rb +1 -1
- data/lib/lago_ruby/models/add_ons_paginated.rb +1 -1
- data/lib/lago_ruby/models/api_error_bad_request.rb +1 -1
- data/lib/lago_ruby/models/api_error_forbidden.rb +1 -1
- data/lib/lago_ruby/models/api_error_not_allowed.rb +1 -1
- data/lib/lago_ruby/models/api_error_not_found.rb +1 -1
- data/lib/lago_ruby/models/api_error_unauthorized.rb +1 -1
- data/lib/lago_ruby/models/api_error_unprocessable_entity.rb +1 -1
- data/lib/lago_ruby/models/applied_coupon.rb +1 -1
- data/lib/lago_ruby/models/applied_coupon_input.rb +1 -1
- data/lib/lago_ruby/models/applied_coupon_input_applied_coupon.rb +1 -1
- data/lib/lago_ruby/models/applied_coupon_object.rb +1 -1
- data/lib/lago_ruby/models/applied_coupon_object_extended.rb +1 -1
- data/lib/lago_ruby/models/applied_coupons_paginated.rb +1 -1
- data/lib/lago_ruby/models/base_applied_tax.rb +1 -1
- data/lib/lago_ruby/models/billable_metric.rb +1 -1
- data/lib/lago_ruby/models/billable_metric_base_input.rb +1 -1
- data/lib/lago_ruby/models/billable_metric_create_input.rb +1 -1
- data/lib/lago_ruby/models/billable_metric_create_input_billable_metric.rb +1 -1
- data/lib/lago_ruby/models/billable_metric_group.rb +1 -1
- data/lib/lago_ruby/models/billable_metric_group_values_inner.rb +1 -1
- data/lib/lago_ruby/models/billable_metric_group_values_inner_one_of.rb +1 -1
- data/lib/lago_ruby/models/billable_metric_object.rb +1 -1
- data/lib/lago_ruby/models/billable_metric_update_input.rb +1 -1
- data/lib/lago_ruby/models/billable_metrics_paginated.rb +1 -1
- data/lib/lago_ruby/models/charge_object.rb +1 -1
- data/lib/lago_ruby/models/charge_object_properties.rb +1 -1
- data/lib/lago_ruby/models/charge_properties.rb +1 -1
- data/lib/lago_ruby/models/charge_properties_graduated_percentage_ranges_inner.rb +1 -1
- data/lib/lago_ruby/models/charge_properties_graduated_ranges_inner.rb +1 -1
- data/lib/lago_ruby/models/charge_properties_volume_ranges_inner.rb +1 -1
- data/lib/lago_ruby/models/country.rb +1 -1
- data/lib/lago_ruby/models/coupon.rb +1 -1
- data/lib/lago_ruby/models/coupon_base_input.rb +1 -1
- data/lib/lago_ruby/models/coupon_base_input_applies_to.rb +1 -1
- data/lib/lago_ruby/models/coupon_create_input.rb +1 -1
- data/lib/lago_ruby/models/coupon_create_input_coupon.rb +1 -1
- data/lib/lago_ruby/models/coupon_object.rb +1 -1
- data/lib/lago_ruby/models/coupon_update_input.rb +1 -1
- data/lib/lago_ruby/models/coupons_paginated.rb +1 -1
- data/lib/lago_ruby/models/credit_note.rb +1 -1
- data/lib/lago_ruby/models/credit_note_applied_tax_object.rb +1 -1
- data/lib/lago_ruby/models/credit_note_create_input.rb +1 -1
- data/lib/lago_ruby/models/credit_note_create_input_credit_note.rb +1 -1
- data/lib/lago_ruby/models/credit_note_estimate_input.rb +1 -1
- data/lib/lago_ruby/models/credit_note_estimate_input_credit_note.rb +1 -1
- data/lib/lago_ruby/models/credit_note_estimate_input_credit_note_items_inner.rb +1 -1
- data/lib/lago_ruby/models/credit_note_estimated.rb +1 -1
- data/lib/lago_ruby/models/credit_note_estimated_estimated_credit_note.rb +1 -1
- data/lib/lago_ruby/models/credit_note_estimated_estimated_credit_note_applied_taxes_inner.rb +1 -1
- data/lib/lago_ruby/models/credit_note_estimated_estimated_credit_note_items_inner.rb +1 -1
- data/lib/lago_ruby/models/credit_note_item_object.rb +1 -1
- data/lib/lago_ruby/models/credit_note_item_object_fee.rb +5 -5
- data/lib/lago_ruby/models/credit_note_object.rb +1 -1
- data/lib/lago_ruby/models/credit_note_update_input.rb +1 -1
- data/lib/lago_ruby/models/credit_note_update_input_credit_note.rb +1 -1
- data/lib/lago_ruby/models/credit_notes.rb +1 -1
- data/lib/lago_ruby/models/credit_object.rb +1 -1
- data/lib/lago_ruby/models/credit_object_invoice.rb +1 -1
- data/lib/lago_ruby/models/credit_object_item.rb +1 -1
- data/lib/lago_ruby/models/currency.rb +1 -1
- data/lib/lago_ruby/models/customer.rb +1 -1
- data/lib/lago_ruby/models/customer_billing_configuration.rb +1 -1
- data/lib/lago_ruby/models/customer_charge_usage_object.rb +1 -1
- data/lib/lago_ruby/models/customer_charge_usage_object_billable_metric.rb +1 -1
- data/lib/lago_ruby/models/customer_charge_usage_object_charge.rb +15 -5
- data/lib/lago_ruby/models/customer_charge_usage_object_groups_inner.rb +1 -1
- data/lib/lago_ruby/models/customer_create_input.rb +1 -1
- data/lib/lago_ruby/models/customer_create_input_customer.rb +1 -1
- data/lib/lago_ruby/models/customer_create_input_customer_metadata_inner.rb +1 -1
- data/lib/lago_ruby/models/customer_metadata.rb +1 -1
- data/lib/lago_ruby/models/customer_object.rb +1 -1
- data/lib/lago_ruby/models/customer_object_extended.rb +1 -1
- data/lib/lago_ruby/models/customer_past_usage.rb +1 -1
- data/lib/lago_ruby/models/customer_usage.rb +1 -1
- data/lib/lago_ruby/models/customer_usage_object.rb +1 -1
- data/lib/lago_ruby/models/customers_paginated.rb +1 -1
- data/lib/lago_ruby/models/event.rb +1 -1
- data/lib/lago_ruby/models/event_batch_input.rb +1 -1
- data/lib/lago_ruby/models/event_batch_input_event.rb +1 -1
- data/lib/lago_ruby/models/event_batch_input_event_properties.rb +1 -1
- data/lib/lago_ruby/models/event_estimate_fees_input.rb +1 -1
- data/lib/lago_ruby/models/event_estimate_fees_input_event.rb +1 -1
- data/lib/lago_ruby/models/event_input.rb +1 -1
- data/lib/lago_ruby/models/event_input_event.rb +1 -1
- data/lib/lago_ruby/models/event_input_event_timestamp.rb +1 -1
- data/lib/lago_ruby/models/event_object.rb +1 -1
- data/lib/lago_ruby/models/event_object_properties.rb +1 -1
- data/lib/lago_ruby/models/fee.rb +1 -1
- data/lib/lago_ruby/models/fee_applied_tax_object.rb +1 -1
- data/lib/lago_ruby/models/fee_object.rb +5 -5
- data/lib/lago_ruby/models/fee_object_item.rb +1 -1
- data/lib/lago_ruby/models/fee_update_input.rb +1 -1
- data/lib/lago_ruby/models/fee_update_input_fee.rb +1 -1
- data/lib/lago_ruby/models/fees.rb +1 -1
- data/lib/lago_ruby/models/fees_paginated.rb +1 -1
- data/lib/lago_ruby/models/generate_customer_checkout_url200_response.rb +246 -0
- data/lib/lago_ruby/models/get_customer_portal_url200_response.rb +1 -1
- data/lib/lago_ruby/models/get_customer_portal_url200_response_customer.rb +1 -1
- data/lib/lago_ruby/models/gross_revenue_object.rb +241 -0
- data/lib/lago_ruby/models/gross_revenues.rb +223 -0
- data/lib/lago_ruby/models/group_object.rb +1 -1
- data/lib/lago_ruby/models/group_properties_object.rb +1 -1
- data/lib/lago_ruby/models/group_properties_object_values.rb +1 -1
- data/lib/lago_ruby/models/groups_paginated.rb +1 -1
- data/lib/lago_ruby/models/invoice.rb +1 -1
- data/lib/lago_ruby/models/invoice_applied_tax_object.rb +1 -1
- data/lib/lago_ruby/models/invoice_metadata_object.rb +1 -1
- data/lib/lago_ruby/models/invoice_object.rb +1 -1
- data/lib/lago_ruby/models/invoice_object_customer.rb +1 -1
- data/lib/lago_ruby/models/invoice_object_extended.rb +1 -1
- data/lib/lago_ruby/models/invoice_one_off_create_input.rb +1 -1
- data/lib/lago_ruby/models/invoice_one_off_create_input_invoice.rb +1 -1
- data/lib/lago_ruby/models/invoice_one_off_create_input_invoice_fees_inner.rb +1 -1
- data/lib/lago_ruby/models/invoice_update_input.rb +1 -1
- data/lib/lago_ruby/models/invoice_update_input_invoice.rb +1 -1
- data/lib/lago_ruby/models/invoice_update_input_invoice_metadata_inner.rb +1 -1
- data/lib/lago_ruby/models/invoiced_usage_object.rb +265 -0
- data/lib/lago_ruby/models/invoiced_usages.rb +223 -0
- data/lib/lago_ruby/models/invoices_paginated.rb +1 -1
- data/lib/lago_ruby/models/mrr_object.rb +241 -0
- data/lib/lago_ruby/models/mrrs.rb +223 -0
- data/lib/lago_ruby/models/organization.rb +1 -1
- data/lib/lago_ruby/models/organization_billing_configuration.rb +1 -1
- data/lib/lago_ruby/models/organization_object.rb +11 -2
- data/lib/lago_ruby/models/organization_update_input.rb +1 -1
- data/lib/lago_ruby/models/organization_update_input_organization.rb +11 -2
- data/lib/lago_ruby/models/outstanding_invoice_object.rb +309 -0
- data/lib/lago_ruby/models/outstanding_invoices.rb +223 -0
- data/lib/lago_ruby/models/pagination_meta.rb +1 -1
- data/lib/lago_ruby/models/plan.rb +1 -1
- data/lib/lago_ruby/models/plan_create_input.rb +1 -1
- data/lib/lago_ruby/models/plan_create_input_plan.rb +1 -1
- data/lib/lago_ruby/models/plan_create_input_plan_charges_inner.rb +1 -1
- data/lib/lago_ruby/models/plan_create_input_plan_charges_inner_group_properties_inner.rb +1 -1
- data/lib/lago_ruby/models/plan_object.rb +1 -1
- data/lib/lago_ruby/models/plan_overrides_object.rb +1 -1
- data/lib/lago_ruby/models/plan_overrides_object_charges_inner.rb +12 -2
- data/lib/lago_ruby/models/plan_update_input.rb +1 -1
- data/lib/lago_ruby/models/plan_update_input_plan.rb +1 -1
- data/lib/lago_ruby/models/plan_update_input_plan_charges_inner.rb +1 -1
- data/lib/lago_ruby/models/plans_paginated.rb +1 -1
- data/lib/lago_ruby/models/subscription.rb +1 -1
- data/lib/lago_ruby/models/subscription_create_input.rb +1 -1
- data/lib/lago_ruby/models/subscription_create_input_subscription.rb +1 -1
- data/lib/lago_ruby/models/subscription_object.rb +1 -1
- data/lib/lago_ruby/models/subscription_object_extended.rb +1 -1
- data/lib/lago_ruby/models/subscription_update_input.rb +1 -1
- data/lib/lago_ruby/models/subscription_update_input_subscription.rb +1 -1
- data/lib/lago_ruby/models/subscriptions_paginated.rb +1 -1
- data/lib/lago_ruby/models/tax.rb +1 -1
- data/lib/lago_ruby/models/tax_base_input.rb +1 -1
- data/lib/lago_ruby/models/tax_create_input.rb +1 -1
- data/lib/lago_ruby/models/tax_create_input_tax.rb +1 -1
- data/lib/lago_ruby/models/tax_object.rb +1 -1
- data/lib/lago_ruby/models/tax_update_input.rb +1 -1
- data/lib/lago_ruby/models/taxes_paginated.rb +1 -1
- data/lib/lago_ruby/models/timezone.rb +1 -1
- data/lib/lago_ruby/models/wallet.rb +1 -1
- data/lib/lago_ruby/models/wallet_create_input.rb +1 -1
- data/lib/lago_ruby/models/wallet_create_input_wallet.rb +1 -1
- data/lib/lago_ruby/models/wallet_object.rb +1 -1
- data/lib/lago_ruby/models/wallet_transaction_create_input.rb +1 -1
- data/lib/lago_ruby/models/wallet_transaction_create_input_wallet_transaction.rb +1 -1
- data/lib/lago_ruby/models/wallet_transaction_object.rb +1 -1
- data/lib/lago_ruby/models/wallet_transactions.rb +1 -1
- data/lib/lago_ruby/models/wallet_transactions_paginated.rb +1 -1
- data/lib/lago_ruby/models/wallet_update_input.rb +1 -1
- data/lib/lago_ruby/models/wallet_update_input_wallet.rb +1 -1
- data/lib/lago_ruby/models/wallets_paginated.rb +1 -1
- data/lib/lago_ruby/models/webhook_endpoint.rb +1 -1
- data/lib/lago_ruby/models/webhook_endpoint_create_input.rb +1 -1
- data/lib/lago_ruby/models/webhook_endpoint_create_input_webhook_endpoint.rb +1 -1
- data/lib/lago_ruby/models/webhook_endpoint_object.rb +1 -1
- data/lib/lago_ruby/models/webhook_endpoint_update_input.rb +1 -1
- data/lib/lago_ruby/models/webhook_endpoints_paginated.rb +1 -1
- data/lib/lago_ruby/version.rb +2 -2
- data/lib/lago_ruby.rb +11 -1
- data/spec/api/analytics_api_spec.rb +85 -0
- data/spec/api_client_spec.rb +1 -1
- data/spec/configuration_spec.rb +1 -1
- data/spec/models/generate_customer_checkout_url200_response_spec.rb +54 -0
- data/spec/models/gross_revenue_object_spec.rb +48 -0
- data/spec/models/gross_revenues_spec.rb +36 -0
- data/spec/models/invoiced_usage_object_spec.rb +54 -0
- data/spec/models/invoiced_usages_spec.rb +36 -0
- data/spec/models/mrr_object_spec.rb +48 -0
- data/spec/models/mrrs_spec.rb +36 -0
- data/spec/models/outstanding_invoice_object_spec.rb +64 -0
- data/spec/models/outstanding_invoices_spec.rb +36 -0
- data/spec/spec_helper.rb +1 -1
- metadata +204 -164
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 0.51.0-beta
|
7
7
|
Contact: tech@getlago.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 7.
|
9
|
+
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -32,6 +32,8 @@ module LagoAPI
|
|
32
32
|
|
33
33
|
attr_accessor :country
|
34
34
|
|
35
|
+
attr_accessor :default_currency
|
36
|
+
|
35
37
|
# The first line of your organization’s billing address.
|
36
38
|
attr_accessor :address_line1
|
37
39
|
|
@@ -78,6 +80,7 @@ module LagoAPI
|
|
78
80
|
:'webhook_url' => :'webhook_url',
|
79
81
|
:'webhook_urls' => :'webhook_urls',
|
80
82
|
:'country' => :'country',
|
83
|
+
:'default_currency' => :'default_currency',
|
81
84
|
:'address_line1' => :'address_line1',
|
82
85
|
:'address_line2' => :'address_line2',
|
83
86
|
:'state' => :'state',
|
@@ -108,6 +111,7 @@ module LagoAPI
|
|
108
111
|
:'webhook_url' => :'String',
|
109
112
|
:'webhook_urls' => :'Array<String>',
|
110
113
|
:'country' => :'Country',
|
114
|
+
:'default_currency' => :'Currency',
|
111
115
|
:'address_line1' => :'String',
|
112
116
|
:'address_line2' => :'String',
|
113
117
|
:'state' => :'String',
|
@@ -189,6 +193,10 @@ module LagoAPI
|
|
189
193
|
self.country = attributes[:'country']
|
190
194
|
end
|
191
195
|
|
196
|
+
if attributes.key?(:'default_currency')
|
197
|
+
self.default_currency = attributes[:'default_currency']
|
198
|
+
end
|
199
|
+
|
192
200
|
if attributes.key?(:'address_line1')
|
193
201
|
self.address_line1 = attributes[:'address_line1']
|
194
202
|
end
|
@@ -287,6 +295,7 @@ module LagoAPI
|
|
287
295
|
webhook_url == o.webhook_url &&
|
288
296
|
webhook_urls == o.webhook_urls &&
|
289
297
|
country == o.country &&
|
298
|
+
default_currency == o.default_currency &&
|
290
299
|
address_line1 == o.address_line1 &&
|
291
300
|
address_line2 == o.address_line2 &&
|
292
301
|
state == o.state &&
|
@@ -311,7 +320,7 @@ module LagoAPI
|
|
311
320
|
# Calculates hash code according to all attributes.
|
312
321
|
# @return [Integer] Hash code
|
313
322
|
def hash
|
314
|
-
[lago_id, name, created_at, webhook_url, webhook_urls, country, address_line1, address_line2, state, zipcode, email, city, legal_name, legal_number, net_payment_term, tax_identification_number, timezone, billing_configuration, taxes].hash
|
323
|
+
[lago_id, name, created_at, webhook_url, webhook_urls, country, default_currency, address_line1, address_line2, state, zipcode, email, city, legal_name, legal_number, net_payment_term, tax_identification_number, timezone, billing_configuration, taxes].hash
|
315
324
|
end
|
316
325
|
|
317
326
|
# Builds the object from hash
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 0.51.0-beta
|
7
7
|
Contact: tech@getlago.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 7.
|
9
|
+
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -20,6 +20,8 @@ module LagoAPI
|
|
20
20
|
|
21
21
|
attr_accessor :country
|
22
22
|
|
23
|
+
attr_accessor :default_currency
|
24
|
+
|
23
25
|
# The first line of your organization’s billing address.
|
24
26
|
attr_accessor :address_line1
|
25
27
|
|
@@ -84,6 +86,7 @@ module LagoAPI
|
|
84
86
|
{
|
85
87
|
:'webhook_url' => :'webhook_url',
|
86
88
|
:'country' => :'country',
|
89
|
+
:'default_currency' => :'default_currency',
|
87
90
|
:'address_line1' => :'address_line1',
|
88
91
|
:'address_line2' => :'address_line2',
|
89
92
|
:'state' => :'state',
|
@@ -110,6 +113,7 @@ module LagoAPI
|
|
110
113
|
{
|
111
114
|
:'webhook_url' => :'String',
|
112
115
|
:'country' => :'Country',
|
116
|
+
:'default_currency' => :'Currency',
|
113
117
|
:'address_line1' => :'String',
|
114
118
|
:'address_line2' => :'String',
|
115
119
|
:'state' => :'String',
|
@@ -165,6 +169,10 @@ module LagoAPI
|
|
165
169
|
self.country = attributes[:'country']
|
166
170
|
end
|
167
171
|
|
172
|
+
if attributes.key?(:'default_currency')
|
173
|
+
self.default_currency = attributes[:'default_currency']
|
174
|
+
end
|
175
|
+
|
168
176
|
if attributes.key?(:'address_line1')
|
169
177
|
self.address_line1 = attributes[:'address_line1']
|
170
178
|
end
|
@@ -242,6 +250,7 @@ module LagoAPI
|
|
242
250
|
self.class == o.class &&
|
243
251
|
webhook_url == o.webhook_url &&
|
244
252
|
country == o.country &&
|
253
|
+
default_currency == o.default_currency &&
|
245
254
|
address_line1 == o.address_line1 &&
|
246
255
|
address_line2 == o.address_line2 &&
|
247
256
|
state == o.state &&
|
@@ -266,7 +275,7 @@ module LagoAPI
|
|
266
275
|
# Calculates hash code according to all attributes.
|
267
276
|
# @return [Integer] Hash code
|
268
277
|
def hash
|
269
|
-
[webhook_url, country, address_line1, address_line2, state, zipcode, email, city, legal_name, legal_number, net_payment_term, tax_identification_number, timezone, email_settings, billing_configuration].hash
|
278
|
+
[webhook_url, country, default_currency, address_line1, address_line2, state, zipcode, email, city, legal_name, legal_number, net_payment_term, tax_identification_number, timezone, email_settings, billing_configuration].hash
|
270
279
|
end
|
271
280
|
|
272
281
|
# Builds the object from hash
|
@@ -0,0 +1,309 @@
|
|
1
|
+
=begin
|
2
|
+
#Lago API documentation
|
3
|
+
|
4
|
+
#Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 0.51.0-beta
|
7
|
+
Contact: tech@getlago.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module LagoAPI
|
17
|
+
class OutstandingInvoiceObject
|
18
|
+
# Identifies the month to analyze revenue.
|
19
|
+
attr_accessor :month
|
20
|
+
|
21
|
+
# The payment status of the invoices.
|
22
|
+
attr_accessor :payment_status
|
23
|
+
|
24
|
+
# Contains invoices count.
|
25
|
+
attr_accessor :invoices_count
|
26
|
+
|
27
|
+
# The total amount of revenue for a period, expressed in cents.
|
28
|
+
attr_accessor :amount_cents
|
29
|
+
|
30
|
+
attr_accessor :currency
|
31
|
+
|
32
|
+
class EnumAttributeValidator
|
33
|
+
attr_reader :datatype
|
34
|
+
attr_reader :allowable_values
|
35
|
+
|
36
|
+
def initialize(datatype, allowable_values)
|
37
|
+
@allowable_values = allowable_values.map do |value|
|
38
|
+
case datatype.to_s
|
39
|
+
when /Integer/i
|
40
|
+
value.to_i
|
41
|
+
when /Float/i
|
42
|
+
value.to_f
|
43
|
+
else
|
44
|
+
value
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def valid?(value)
|
50
|
+
!value || allowable_values.include?(value)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
55
|
+
def self.attribute_map
|
56
|
+
{
|
57
|
+
:'month' => :'month',
|
58
|
+
:'payment_status' => :'payment_status',
|
59
|
+
:'invoices_count' => :'invoices_count',
|
60
|
+
:'amount_cents' => :'amount_cents',
|
61
|
+
:'currency' => :'currency'
|
62
|
+
}
|
63
|
+
end
|
64
|
+
|
65
|
+
# Returns all the JSON keys this model knows about
|
66
|
+
def self.acceptable_attributes
|
67
|
+
attribute_map.values
|
68
|
+
end
|
69
|
+
|
70
|
+
# Attribute type mapping.
|
71
|
+
def self.openapi_types
|
72
|
+
{
|
73
|
+
:'month' => :'String',
|
74
|
+
:'payment_status' => :'String',
|
75
|
+
:'invoices_count' => :'Integer',
|
76
|
+
:'amount_cents' => :'Integer',
|
77
|
+
:'currency' => :'Currency'
|
78
|
+
}
|
79
|
+
end
|
80
|
+
|
81
|
+
# List of attributes with nullable: true
|
82
|
+
def self.openapi_nullable
|
83
|
+
Set.new([
|
84
|
+
])
|
85
|
+
end
|
86
|
+
|
87
|
+
# Initializes the object
|
88
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
89
|
+
def initialize(attributes = {})
|
90
|
+
if (!attributes.is_a?(Hash))
|
91
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `LagoAPI::OutstandingInvoiceObject` initialize method"
|
92
|
+
end
|
93
|
+
|
94
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
95
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
96
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
97
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `LagoAPI::OutstandingInvoiceObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
98
|
+
end
|
99
|
+
h[k.to_sym] = v
|
100
|
+
}
|
101
|
+
|
102
|
+
if attributes.key?(:'month')
|
103
|
+
self.month = attributes[:'month']
|
104
|
+
else
|
105
|
+
self.month = nil
|
106
|
+
end
|
107
|
+
|
108
|
+
if attributes.key?(:'payment_status')
|
109
|
+
self.payment_status = attributes[:'payment_status']
|
110
|
+
end
|
111
|
+
|
112
|
+
if attributes.key?(:'invoices_count')
|
113
|
+
self.invoices_count = attributes[:'invoices_count']
|
114
|
+
else
|
115
|
+
self.invoices_count = nil
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.key?(:'amount_cents')
|
119
|
+
self.amount_cents = attributes[:'amount_cents']
|
120
|
+
else
|
121
|
+
self.amount_cents = nil
|
122
|
+
end
|
123
|
+
|
124
|
+
if attributes.key?(:'currency')
|
125
|
+
self.currency = attributes[:'currency']
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
130
|
+
# @return Array for valid properties with the reasons
|
131
|
+
def list_invalid_properties
|
132
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
133
|
+
invalid_properties = Array.new
|
134
|
+
if @month.nil?
|
135
|
+
invalid_properties.push('invalid value for "month", month cannot be nil.')
|
136
|
+
end
|
137
|
+
|
138
|
+
if @invoices_count.nil?
|
139
|
+
invalid_properties.push('invalid value for "invoices_count", invoices_count cannot be nil.')
|
140
|
+
end
|
141
|
+
|
142
|
+
if @amount_cents.nil?
|
143
|
+
invalid_properties.push('invalid value for "amount_cents", amount_cents cannot be nil.')
|
144
|
+
end
|
145
|
+
|
146
|
+
invalid_properties
|
147
|
+
end
|
148
|
+
|
149
|
+
# Check to see if the all the properties in the model are valid
|
150
|
+
# @return true if the model is valid
|
151
|
+
def valid?
|
152
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
153
|
+
return false if @month.nil?
|
154
|
+
payment_status_validator = EnumAttributeValidator.new('String', ["pending", "succeeded", "failed"])
|
155
|
+
return false unless payment_status_validator.valid?(@payment_status)
|
156
|
+
return false if @invoices_count.nil?
|
157
|
+
return false if @amount_cents.nil?
|
158
|
+
true
|
159
|
+
end
|
160
|
+
|
161
|
+
# Custom attribute writer method checking allowed values (enum).
|
162
|
+
# @param [Object] payment_status Object to be assigned
|
163
|
+
def payment_status=(payment_status)
|
164
|
+
validator = EnumAttributeValidator.new('String', ["pending", "succeeded", "failed"])
|
165
|
+
unless validator.valid?(payment_status)
|
166
|
+
fail ArgumentError, "invalid value for \"payment_status\", must be one of #{validator.allowable_values}."
|
167
|
+
end
|
168
|
+
@payment_status = payment_status
|
169
|
+
end
|
170
|
+
|
171
|
+
# Checks equality by comparing each attribute.
|
172
|
+
# @param [Object] Object to be compared
|
173
|
+
def ==(o)
|
174
|
+
return true if self.equal?(o)
|
175
|
+
self.class == o.class &&
|
176
|
+
month == o.month &&
|
177
|
+
payment_status == o.payment_status &&
|
178
|
+
invoices_count == o.invoices_count &&
|
179
|
+
amount_cents == o.amount_cents &&
|
180
|
+
currency == o.currency
|
181
|
+
end
|
182
|
+
|
183
|
+
# @see the `==` method
|
184
|
+
# @param [Object] Object to be compared
|
185
|
+
def eql?(o)
|
186
|
+
self == o
|
187
|
+
end
|
188
|
+
|
189
|
+
# Calculates hash code according to all attributes.
|
190
|
+
# @return [Integer] Hash code
|
191
|
+
def hash
|
192
|
+
[month, payment_status, invoices_count, amount_cents, currency].hash
|
193
|
+
end
|
194
|
+
|
195
|
+
# Builds the object from hash
|
196
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
197
|
+
# @return [Object] Returns the model itself
|
198
|
+
def self.build_from_hash(attributes)
|
199
|
+
return nil unless attributes.is_a?(Hash)
|
200
|
+
attributes = attributes.transform_keys(&:to_sym)
|
201
|
+
transformed_hash = {}
|
202
|
+
openapi_types.each_pair do |key, type|
|
203
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
204
|
+
transformed_hash["#{key}"] = nil
|
205
|
+
elsif type =~ /\AArray<(.*)>/i
|
206
|
+
# check to ensure the input is an array given that the attribute
|
207
|
+
# is documented as an array but the input is not
|
208
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
209
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
210
|
+
end
|
211
|
+
elsif !attributes[attribute_map[key]].nil?
|
212
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
213
|
+
end
|
214
|
+
end
|
215
|
+
new(transformed_hash)
|
216
|
+
end
|
217
|
+
|
218
|
+
# Deserializes the data based on type
|
219
|
+
# @param string type Data type
|
220
|
+
# @param string value Value to be deserialized
|
221
|
+
# @return [Object] Deserialized data
|
222
|
+
def self._deserialize(type, value)
|
223
|
+
case type.to_sym
|
224
|
+
when :Time
|
225
|
+
Time.parse(value)
|
226
|
+
when :Date
|
227
|
+
Date.parse(value)
|
228
|
+
when :String
|
229
|
+
value.to_s
|
230
|
+
when :Integer
|
231
|
+
value.to_i
|
232
|
+
when :Float
|
233
|
+
value.to_f
|
234
|
+
when :Boolean
|
235
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
236
|
+
true
|
237
|
+
else
|
238
|
+
false
|
239
|
+
end
|
240
|
+
when :Object
|
241
|
+
# generic object (usually a Hash), return directly
|
242
|
+
value
|
243
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
244
|
+
inner_type = Regexp.last_match[:inner_type]
|
245
|
+
value.map { |v| _deserialize(inner_type, v) }
|
246
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
247
|
+
k_type = Regexp.last_match[:k_type]
|
248
|
+
v_type = Regexp.last_match[:v_type]
|
249
|
+
{}.tap do |hash|
|
250
|
+
value.each do |k, v|
|
251
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
252
|
+
end
|
253
|
+
end
|
254
|
+
else # model
|
255
|
+
# models (e.g. Pet) or oneOf
|
256
|
+
klass = LagoAPI.const_get(type)
|
257
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
258
|
+
end
|
259
|
+
end
|
260
|
+
|
261
|
+
# Returns the string representation of the object
|
262
|
+
# @return [String] String presentation of the object
|
263
|
+
def to_s
|
264
|
+
to_hash.to_s
|
265
|
+
end
|
266
|
+
|
267
|
+
# to_body is an alias to to_hash (backward compatibility)
|
268
|
+
# @return [Hash] Returns the object in the form of hash
|
269
|
+
def to_body
|
270
|
+
to_hash
|
271
|
+
end
|
272
|
+
|
273
|
+
# Returns the object in the form of hash
|
274
|
+
# @return [Hash] Returns the object in the form of hash
|
275
|
+
def to_hash
|
276
|
+
hash = {}
|
277
|
+
self.class.attribute_map.each_pair do |attr, param|
|
278
|
+
value = self.send(attr)
|
279
|
+
if value.nil?
|
280
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
281
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
282
|
+
end
|
283
|
+
|
284
|
+
hash[param] = _to_hash(value)
|
285
|
+
end
|
286
|
+
hash
|
287
|
+
end
|
288
|
+
|
289
|
+
# Outputs non-array value in the form of hash
|
290
|
+
# For object, use to_hash. Otherwise, just return the value
|
291
|
+
# @param [Object] value Any valid value
|
292
|
+
# @return [Hash] Returns the value in the form of hash
|
293
|
+
def _to_hash(value)
|
294
|
+
if value.is_a?(Array)
|
295
|
+
value.compact.map { |v| _to_hash(v) }
|
296
|
+
elsif value.is_a?(Hash)
|
297
|
+
{}.tap do |hash|
|
298
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
299
|
+
end
|
300
|
+
elsif value.respond_to? :to_hash
|
301
|
+
value.to_hash
|
302
|
+
else
|
303
|
+
value
|
304
|
+
end
|
305
|
+
end
|
306
|
+
|
307
|
+
end
|
308
|
+
|
309
|
+
end
|
@@ -0,0 +1,223 @@
|
|
1
|
+
=begin
|
2
|
+
#Lago API documentation
|
3
|
+
|
4
|
+
#Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 0.51.0-beta
|
7
|
+
Contact: tech@getlago.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module LagoAPI
|
17
|
+
class OutstandingInvoices
|
18
|
+
attr_accessor :outstanding_invoices
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'outstanding_invoices' => :'outstanding_invoices'
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Returns all the JSON keys this model knows about
|
28
|
+
def self.acceptable_attributes
|
29
|
+
attribute_map.values
|
30
|
+
end
|
31
|
+
|
32
|
+
# Attribute type mapping.
|
33
|
+
def self.openapi_types
|
34
|
+
{
|
35
|
+
:'outstanding_invoices' => :'Array<OutstandingInvoiceObject>'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# List of attributes with nullable: true
|
40
|
+
def self.openapi_nullable
|
41
|
+
Set.new([
|
42
|
+
])
|
43
|
+
end
|
44
|
+
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
+
def initialize(attributes = {})
|
48
|
+
if (!attributes.is_a?(Hash))
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `LagoAPI::OutstandingInvoices` initialize method"
|
50
|
+
end
|
51
|
+
|
52
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
53
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `LagoAPI::OutstandingInvoices`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
|
+
end
|
57
|
+
h[k.to_sym] = v
|
58
|
+
}
|
59
|
+
|
60
|
+
if attributes.key?(:'outstanding_invoices')
|
61
|
+
if (value = attributes[:'outstanding_invoices']).is_a?(Array)
|
62
|
+
self.outstanding_invoices = value
|
63
|
+
end
|
64
|
+
else
|
65
|
+
self.outstanding_invoices = nil
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
70
|
+
# @return Array for valid properties with the reasons
|
71
|
+
def list_invalid_properties
|
72
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
73
|
+
invalid_properties = Array.new
|
74
|
+
if @outstanding_invoices.nil?
|
75
|
+
invalid_properties.push('invalid value for "outstanding_invoices", outstanding_invoices cannot be nil.')
|
76
|
+
end
|
77
|
+
|
78
|
+
invalid_properties
|
79
|
+
end
|
80
|
+
|
81
|
+
# Check to see if the all the properties in the model are valid
|
82
|
+
# @return true if the model is valid
|
83
|
+
def valid?
|
84
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
85
|
+
return false if @outstanding_invoices.nil?
|
86
|
+
true
|
87
|
+
end
|
88
|
+
|
89
|
+
# Checks equality by comparing each attribute.
|
90
|
+
# @param [Object] Object to be compared
|
91
|
+
def ==(o)
|
92
|
+
return true if self.equal?(o)
|
93
|
+
self.class == o.class &&
|
94
|
+
outstanding_invoices == o.outstanding_invoices
|
95
|
+
end
|
96
|
+
|
97
|
+
# @see the `==` method
|
98
|
+
# @param [Object] Object to be compared
|
99
|
+
def eql?(o)
|
100
|
+
self == o
|
101
|
+
end
|
102
|
+
|
103
|
+
# Calculates hash code according to all attributes.
|
104
|
+
# @return [Integer] Hash code
|
105
|
+
def hash
|
106
|
+
[outstanding_invoices].hash
|
107
|
+
end
|
108
|
+
|
109
|
+
# Builds the object from hash
|
110
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
111
|
+
# @return [Object] Returns the model itself
|
112
|
+
def self.build_from_hash(attributes)
|
113
|
+
return nil unless attributes.is_a?(Hash)
|
114
|
+
attributes = attributes.transform_keys(&:to_sym)
|
115
|
+
transformed_hash = {}
|
116
|
+
openapi_types.each_pair do |key, type|
|
117
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
118
|
+
transformed_hash["#{key}"] = nil
|
119
|
+
elsif type =~ /\AArray<(.*)>/i
|
120
|
+
# check to ensure the input is an array given that the attribute
|
121
|
+
# is documented as an array but the input is not
|
122
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
123
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
124
|
+
end
|
125
|
+
elsif !attributes[attribute_map[key]].nil?
|
126
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
127
|
+
end
|
128
|
+
end
|
129
|
+
new(transformed_hash)
|
130
|
+
end
|
131
|
+
|
132
|
+
# Deserializes the data based on type
|
133
|
+
# @param string type Data type
|
134
|
+
# @param string value Value to be deserialized
|
135
|
+
# @return [Object] Deserialized data
|
136
|
+
def self._deserialize(type, value)
|
137
|
+
case type.to_sym
|
138
|
+
when :Time
|
139
|
+
Time.parse(value)
|
140
|
+
when :Date
|
141
|
+
Date.parse(value)
|
142
|
+
when :String
|
143
|
+
value.to_s
|
144
|
+
when :Integer
|
145
|
+
value.to_i
|
146
|
+
when :Float
|
147
|
+
value.to_f
|
148
|
+
when :Boolean
|
149
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
150
|
+
true
|
151
|
+
else
|
152
|
+
false
|
153
|
+
end
|
154
|
+
when :Object
|
155
|
+
# generic object (usually a Hash), return directly
|
156
|
+
value
|
157
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
158
|
+
inner_type = Regexp.last_match[:inner_type]
|
159
|
+
value.map { |v| _deserialize(inner_type, v) }
|
160
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
161
|
+
k_type = Regexp.last_match[:k_type]
|
162
|
+
v_type = Regexp.last_match[:v_type]
|
163
|
+
{}.tap do |hash|
|
164
|
+
value.each do |k, v|
|
165
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
166
|
+
end
|
167
|
+
end
|
168
|
+
else # model
|
169
|
+
# models (e.g. Pet) or oneOf
|
170
|
+
klass = LagoAPI.const_get(type)
|
171
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
# Returns the string representation of the object
|
176
|
+
# @return [String] String presentation of the object
|
177
|
+
def to_s
|
178
|
+
to_hash.to_s
|
179
|
+
end
|
180
|
+
|
181
|
+
# to_body is an alias to to_hash (backward compatibility)
|
182
|
+
# @return [Hash] Returns the object in the form of hash
|
183
|
+
def to_body
|
184
|
+
to_hash
|
185
|
+
end
|
186
|
+
|
187
|
+
# Returns the object in the form of hash
|
188
|
+
# @return [Hash] Returns the object in the form of hash
|
189
|
+
def to_hash
|
190
|
+
hash = {}
|
191
|
+
self.class.attribute_map.each_pair do |attr, param|
|
192
|
+
value = self.send(attr)
|
193
|
+
if value.nil?
|
194
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
195
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
196
|
+
end
|
197
|
+
|
198
|
+
hash[param] = _to_hash(value)
|
199
|
+
end
|
200
|
+
hash
|
201
|
+
end
|
202
|
+
|
203
|
+
# Outputs non-array value in the form of hash
|
204
|
+
# For object, use to_hash. Otherwise, just return the value
|
205
|
+
# @param [Object] value Any valid value
|
206
|
+
# @return [Hash] Returns the value in the form of hash
|
207
|
+
def _to_hash(value)
|
208
|
+
if value.is_a?(Array)
|
209
|
+
value.compact.map { |v| _to_hash(v) }
|
210
|
+
elsif value.is_a?(Hash)
|
211
|
+
{}.tap do |hash|
|
212
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
213
|
+
end
|
214
|
+
elsif value.respond_to? :to_hash
|
215
|
+
value.to_hash
|
216
|
+
else
|
217
|
+
value
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
end
|
222
|
+
|
223
|
+
end
|