diff --git a/ruby/.openapi-generator/FILES b/ruby/.openapi-generator/FILES index 21d879c..6226808 100644 --- a/ruby/.openapi-generator/FILES +++ b/ruby/.openapi-generator/FILES @@ -1,8 +1,6 @@ .gitignore -.gitlab-ci.yml .rspec .rubocop.yml -.travis.yml Gemfile README.md Rakefile @@ -79,10 +77,11 @@ docs/CreditObjectItem.md docs/Currency.md docs/Customer.md docs/CustomerBillingConfiguration.md +docs/CustomerChargeGroupedUsageObjectInner.md +docs/CustomerChargeGroupsUsageObjectInner.md docs/CustomerChargeUsageObject.md docs/CustomerChargeUsageObjectBillableMetric.md docs/CustomerChargeUsageObjectCharge.md -docs/CustomerChargeUsageObjectGroupsInner.md docs/CustomerCreateInput.md docs/CustomerCreateInputCustomer.md docs/CustomerCreateInputCustomerMetadataInner.md @@ -96,8 +95,6 @@ docs/CustomersApi.md docs/CustomersPaginated.md docs/Event.md docs/EventBatchInput.md -docs/EventBatchInputEvent.md -docs/EventBatchInputEventProperties.md docs/EventEstimateFeesInput.md docs/EventEstimateFeesInputEvent.md docs/EventInput.md @@ -109,6 +106,10 @@ docs/EventsApi.md docs/Fee.md docs/FeeAppliedTaxObject.md docs/FeeObject.md +docs/FeeObjectAmountDetails.md +docs/FeeObjectAmountDetailsAllOfGraduatedPercentageRangesInner.md +docs/FeeObjectAmountDetailsAllOfGraduatedRangesInner.md +docs/FeeObjectAmountDetailsAllOfVolumeRangesInner.md docs/FeeObjectItem.md docs/FeeUpdateInput.md docs/FeeUpdateInputFee.md @@ -116,6 +117,7 @@ docs/Fees.md docs/FeesApi.md docs/FeesPaginated.md docs/GenerateCustomerCheckoutURL200Response.md +docs/GenerateCustomerCheckoutURL200ResponseCustomer.md docs/GetCustomerPortalUrl200Response.md docs/GetCustomerPortalUrl200ResponseCustomer.md docs/GrossRevenueObject.md @@ -126,6 +128,8 @@ docs/GroupPropertiesObjectValues.md docs/GroupsPaginated.md docs/Invoice.md docs/InvoiceAppliedTaxObject.md +docs/InvoiceCollectionObject.md +docs/InvoiceCollections.md docs/InvoiceMetadataObject.md docs/InvoiceObject.md docs/InvoiceObjectCustomer.md @@ -148,8 +152,6 @@ docs/OrganizationObject.md docs/OrganizationUpdateInput.md docs/OrganizationUpdateInputOrganization.md docs/OrganizationsApi.md -docs/OutstandingInvoiceObject.md -docs/OutstandingInvoices.md docs/PaginationMeta.md docs/Plan.md docs/PlanCreateInput.md @@ -185,7 +187,9 @@ docs/Timezone.md docs/Wallet.md docs/WalletCreateInput.md docs/WalletCreateInputWallet.md +docs/WalletCreateInputWalletRecurringTransactionRulesInner.md docs/WalletObject.md +docs/WalletObjectRecurringTransactionRulesInner.md docs/WalletTransactionCreateInput.md docs/WalletTransactionCreateInputWalletTransaction.md docs/WalletTransactionObject.md @@ -193,6 +197,7 @@ docs/WalletTransactions.md docs/WalletTransactionsPaginated.md docs/WalletUpdateInput.md docs/WalletUpdateInputWallet.md +docs/WalletUpdateInputWalletRecurringTransactionRulesInner.md docs/WalletsApi.md docs/WalletsPaginated.md docs/WebhookEndpoint.md @@ -203,7 +208,6 @@ docs/WebhookEndpointUpdateInput.md docs/WebhookEndpointsApi.md docs/WebhookEndpointsPaginated.md docs/WebhooksApi.md -git_push.sh lago_ruby.gemspec lib/lago_ruby.rb lib/lago_ruby/api/add_ons_api.rb @@ -293,10 +297,11 @@ lib/lago_ruby/models/credit_object_item.rb lib/lago_ruby/models/currency.rb lib/lago_ruby/models/customer.rb lib/lago_ruby/models/customer_billing_configuration.rb +lib/lago_ruby/models/customer_charge_grouped_usage_object_inner.rb +lib/lago_ruby/models/customer_charge_groups_usage_object_inner.rb lib/lago_ruby/models/customer_charge_usage_object.rb lib/lago_ruby/models/customer_charge_usage_object_billable_metric.rb lib/lago_ruby/models/customer_charge_usage_object_charge.rb -lib/lago_ruby/models/customer_charge_usage_object_groups_inner.rb lib/lago_ruby/models/customer_create_input.rb lib/lago_ruby/models/customer_create_input_customer.rb lib/lago_ruby/models/customer_create_input_customer_metadata_inner.rb @@ -309,8 +314,6 @@ lib/lago_ruby/models/customer_usage_object.rb lib/lago_ruby/models/customers_paginated.rb lib/lago_ruby/models/event.rb lib/lago_ruby/models/event_batch_input.rb -lib/lago_ruby/models/event_batch_input_event.rb -lib/lago_ruby/models/event_batch_input_event_properties.rb lib/lago_ruby/models/event_estimate_fees_input.rb lib/lago_ruby/models/event_estimate_fees_input_event.rb lib/lago_ruby/models/event_input.rb @@ -321,12 +324,17 @@ lib/lago_ruby/models/event_object_properties.rb lib/lago_ruby/models/fee.rb lib/lago_ruby/models/fee_applied_tax_object.rb lib/lago_ruby/models/fee_object.rb +lib/lago_ruby/models/fee_object_amount_details.rb +lib/lago_ruby/models/fee_object_amount_details_all_of_graduated_percentage_ranges_inner.rb +lib/lago_ruby/models/fee_object_amount_details_all_of_graduated_ranges_inner.rb +lib/lago_ruby/models/fee_object_amount_details_all_of_volume_ranges_inner.rb lib/lago_ruby/models/fee_object_item.rb lib/lago_ruby/models/fee_update_input.rb lib/lago_ruby/models/fee_update_input_fee.rb lib/lago_ruby/models/fees.rb lib/lago_ruby/models/fees_paginated.rb lib/lago_ruby/models/generate_customer_checkout_url200_response.rb +lib/lago_ruby/models/generate_customer_checkout_url200_response_customer.rb lib/lago_ruby/models/get_customer_portal_url200_response.rb lib/lago_ruby/models/get_customer_portal_url200_response_customer.rb lib/lago_ruby/models/gross_revenue_object.rb @@ -337,6 +345,8 @@ lib/lago_ruby/models/group_properties_object_values.rb lib/lago_ruby/models/groups_paginated.rb lib/lago_ruby/models/invoice.rb lib/lago_ruby/models/invoice_applied_tax_object.rb +lib/lago_ruby/models/invoice_collection_object.rb +lib/lago_ruby/models/invoice_collections.rb lib/lago_ruby/models/invoice_metadata_object.rb lib/lago_ruby/models/invoice_object.rb lib/lago_ruby/models/invoice_object_customer.rb @@ -357,8 +367,6 @@ lib/lago_ruby/models/organization_billing_configuration.rb lib/lago_ruby/models/organization_object.rb lib/lago_ruby/models/organization_update_input.rb lib/lago_ruby/models/organization_update_input_organization.rb -lib/lago_ruby/models/outstanding_invoice_object.rb -lib/lago_ruby/models/outstanding_invoices.rb lib/lago_ruby/models/pagination_meta.rb lib/lago_ruby/models/plan.rb lib/lago_ruby/models/plan_create_input.rb @@ -391,7 +399,9 @@ lib/lago_ruby/models/timezone.rb lib/lago_ruby/models/wallet.rb lib/lago_ruby/models/wallet_create_input.rb lib/lago_ruby/models/wallet_create_input_wallet.rb +lib/lago_ruby/models/wallet_create_input_wallet_recurring_transaction_rules_inner.rb lib/lago_ruby/models/wallet_object.rb +lib/lago_ruby/models/wallet_object_recurring_transaction_rules_inner.rb lib/lago_ruby/models/wallet_transaction_create_input.rb lib/lago_ruby/models/wallet_transaction_create_input_wallet_transaction.rb lib/lago_ruby/models/wallet_transaction_object.rb @@ -399,6 +409,7 @@ lib/lago_ruby/models/wallet_transactions.rb lib/lago_ruby/models/wallet_transactions_paginated.rb lib/lago_ruby/models/wallet_update_input.rb lib/lago_ruby/models/wallet_update_input_wallet.rb +lib/lago_ruby/models/wallet_update_input_wallet_recurring_transaction_rules_inner.rb lib/lago_ruby/models/wallets_paginated.rb lib/lago_ruby/models/webhook_endpoint.rb lib/lago_ruby/models/webhook_endpoint_create_input.rb @@ -407,16 +418,16 @@ lib/lago_ruby/models/webhook_endpoint_object.rb lib/lago_ruby/models/webhook_endpoint_update_input.rb lib/lago_ruby/models/webhook_endpoints_paginated.rb lib/lago_ruby/version.rb -spec/api/analytics_api_spec.rb -spec/api_client_spec.rb -spec/configuration_spec.rb -spec/models/generate_customer_checkout_url200_response_spec.rb -spec/models/gross_revenue_object_spec.rb -spec/models/gross_revenues_spec.rb -spec/models/invoiced_usage_object_spec.rb -spec/models/invoiced_usages_spec.rb -spec/models/mrr_object_spec.rb -spec/models/mrrs_spec.rb -spec/models/outstanding_invoice_object_spec.rb -spec/models/outstanding_invoices_spec.rb +spec/models/customer_charge_grouped_usage_object_inner_spec.rb +spec/models/customer_charge_groups_usage_object_inner_spec.rb +spec/models/fee_object_amount_details_all_of_graduated_percentage_ranges_inner_spec.rb +spec/models/fee_object_amount_details_all_of_graduated_ranges_inner_spec.rb +spec/models/fee_object_amount_details_all_of_volume_ranges_inner_spec.rb +spec/models/fee_object_amount_details_spec.rb +spec/models/generate_customer_checkout_url200_response_customer_spec.rb +spec/models/invoice_collection_object_spec.rb +spec/models/invoice_collections_spec.rb +spec/models/wallet_create_input_wallet_recurring_transaction_rules_inner_spec.rb +spec/models/wallet_object_recurring_transaction_rules_inner_spec.rb +spec/models/wallet_update_input_wallet_recurring_transaction_rules_inner_spec.rb spec/spec_helper.rb diff --git a/ruby/.openapi-generator/VERSION b/ruby/.openapi-generator/VERSION index 0f78c31..c9e125b 100644 --- a/ruby/.openapi-generator/VERSION +++ b/ruby/.openapi-generator/VERSION @@ -1 +1 @@ -7.2.0-SNAPSHOT \ No newline at end of file +7.4.0-SNAPSHOT diff --git a/ruby/README.md b/ruby/README.md index 08cbf59..13486ae 100644 --- a/ruby/README.md +++ b/ruby/README.md @@ -6,8 +6,8 @@ Lago API allows your application to push customer information and metrics (event This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 0.51.0-beta -- Package version: 0.52.0-beta +- API version: 0.53.0-beta +- Package version: 0.56.0-beta - Build package: org.openapitools.codegen.languages.RubyClientCodegen [![Gem Version](https://badge.fury.io/rb/lago-ruby.svg)](https://badge.fury.io/rb/lago-ruby) @@ -26,22 +26,22 @@ gem build lago_ruby.gemspec Then either install the gem locally: ```shell -gem install ./lago_ruby-0.52.0-beta.gem +gem install ./lago_ruby-0.56.0-beta.gem ``` -(for development, run `gem install --dev ./lago_ruby-0.52.0-beta.gem` to install the development dependencies) +(for development, run `gem install --dev ./lago_ruby-0.56.0-beta.gem` to install the development dependencies) or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). Finally add this to the Gemfile: - gem 'lago_ruby', '~> 0.52.0-beta' + gem 'lago_ruby', '~> 0.56.0-beta' ### Install from Git -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: +If the Ruby gem is hosted at a git repository: https://github.com/getlago/sdk/go, then add the following in the Gemfile: - gem 'lago_ruby', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' + gem 'lago_ruby', :git => 'https://github.com/getlago/sdk/go.git' ### Include the Ruby code directly @@ -94,9 +94,9 @@ Class | Method | HTTP request | Description *LagoAPI::AddOnsApi* | [**find_all_add_ons**](docs/AddOnsApi.md#find_all_add_ons) | **GET** /add_ons | List all add-ons *LagoAPI::AddOnsApi* | [**update_add_on**](docs/AddOnsApi.md#update_add_on) | **PUT** /add_ons/{code} | Update an add-on *LagoAPI::AnalyticsApi* | [**find_all_gross_revenues**](docs/AnalyticsApi.md#find_all_gross_revenues) | **GET** /analytics/gross_revenue | List gross revenue +*LagoAPI::AnalyticsApi* | [**find_all_invoice_collections**](docs/AnalyticsApi.md#find_all_invoice_collections) | **GET** /analytics/invoice_collection | List of finalized invoices *LagoAPI::AnalyticsApi* | [**find_all_invoiced_usages**](docs/AnalyticsApi.md#find_all_invoiced_usages) | **GET** /analytics/invoiced_usage | List usage revenue *LagoAPI::AnalyticsApi* | [**find_all_mrrs**](docs/AnalyticsApi.md#find_all_mrrs) | **GET** /analytics/mrr | List MRR -*LagoAPI::AnalyticsApi* | [**find_all_outstanding_invoices**](docs/AnalyticsApi.md#find_all_outstanding_invoices) | **GET** /analytics/outstanding_invoices | List outstanding invoices *LagoAPI::BillableMetricsApi* | [**create_billable_metric**](docs/BillableMetricsApi.md#create_billable_metric) | **POST** /billable_metrics | Create a billable metric *LagoAPI::BillableMetricsApi* | [**destroy_billable_metric**](docs/BillableMetricsApi.md#destroy_billable_metric) | **DELETE** /billable_metrics/{code} | Delete a billable metric *LagoAPI::BillableMetricsApi* | [**find_all_billable_metric_groups**](docs/BillableMetricsApi.md#find_all_billable_metric_groups) | **GET** /billable_metrics/{code}/groups | Find a billable metric's groups @@ -142,6 +142,7 @@ Class | Method | HTTP request | Description *LagoAPI::InvoicesApi* | [**refresh_invoice**](docs/InvoicesApi.md#refresh_invoice) | **PUT** /invoices/{lago_id}/refresh | Refresh a draft invoice *LagoAPI::InvoicesApi* | [**retry_payment**](docs/InvoicesApi.md#retry_payment) | **POST** /invoices/{lago_id}/retry_payment | Retry an invoice payment *LagoAPI::InvoicesApi* | [**update_invoice**](docs/InvoicesApi.md#update_invoice) | **PUT** /invoices/{lago_id} | Update an invoice +*LagoAPI::InvoicesApi* | [**void_invoice**](docs/InvoicesApi.md#void_invoice) | **POST** /invoices/{lago_id}/void | Void an invoice *LagoAPI::OrganizationsApi* | [**update_organization**](docs/OrganizationsApi.md#update_organization) | **PUT** /organizations | Update your organization *LagoAPI::PlansApi* | [**create_plan**](docs/PlansApi.md#create_plan) | **POST** /plans | Create a plan *LagoAPI::PlansApi* | [**destroy_plan**](docs/PlansApi.md#destroy_plan) | **DELETE** /plans/{code} | Delete a plan @@ -243,10 +244,11 @@ Class | Method | HTTP request | Description - [LagoAPI::Currency](docs/Currency.md) - [LagoAPI::Customer](docs/Customer.md) - [LagoAPI::CustomerBillingConfiguration](docs/CustomerBillingConfiguration.md) + - [LagoAPI::CustomerChargeGroupedUsageObjectInner](docs/CustomerChargeGroupedUsageObjectInner.md) + - [LagoAPI::CustomerChargeGroupsUsageObjectInner](docs/CustomerChargeGroupsUsageObjectInner.md) - [LagoAPI::CustomerChargeUsageObject](docs/CustomerChargeUsageObject.md) - [LagoAPI::CustomerChargeUsageObjectBillableMetric](docs/CustomerChargeUsageObjectBillableMetric.md) - [LagoAPI::CustomerChargeUsageObjectCharge](docs/CustomerChargeUsageObjectCharge.md) - - [LagoAPI::CustomerChargeUsageObjectGroupsInner](docs/CustomerChargeUsageObjectGroupsInner.md) - [LagoAPI::CustomerCreateInput](docs/CustomerCreateInput.md) - [LagoAPI::CustomerCreateInputCustomer](docs/CustomerCreateInputCustomer.md) - [LagoAPI::CustomerCreateInputCustomerMetadataInner](docs/CustomerCreateInputCustomerMetadataInner.md) @@ -259,8 +261,6 @@ Class | Method | HTTP request | Description - [LagoAPI::CustomersPaginated](docs/CustomersPaginated.md) - [LagoAPI::Event](docs/Event.md) - [LagoAPI::EventBatchInput](docs/EventBatchInput.md) - - [LagoAPI::EventBatchInputEvent](docs/EventBatchInputEvent.md) - - [LagoAPI::EventBatchInputEventProperties](docs/EventBatchInputEventProperties.md) - [LagoAPI::EventEstimateFeesInput](docs/EventEstimateFeesInput.md) - [LagoAPI::EventEstimateFeesInputEvent](docs/EventEstimateFeesInputEvent.md) - [LagoAPI::EventInput](docs/EventInput.md) @@ -271,12 +271,17 @@ Class | Method | HTTP request | Description - [LagoAPI::Fee](docs/Fee.md) - [LagoAPI::FeeAppliedTaxObject](docs/FeeAppliedTaxObject.md) - [LagoAPI::FeeObject](docs/FeeObject.md) + - [LagoAPI::FeeObjectAmountDetails](docs/FeeObjectAmountDetails.md) + - [LagoAPI::FeeObjectAmountDetailsAllOfGraduatedPercentageRangesInner](docs/FeeObjectAmountDetailsAllOfGraduatedPercentageRangesInner.md) + - [LagoAPI::FeeObjectAmountDetailsAllOfGraduatedRangesInner](docs/FeeObjectAmountDetailsAllOfGraduatedRangesInner.md) + - [LagoAPI::FeeObjectAmountDetailsAllOfVolumeRangesInner](docs/FeeObjectAmountDetailsAllOfVolumeRangesInner.md) - [LagoAPI::FeeObjectItem](docs/FeeObjectItem.md) - [LagoAPI::FeeUpdateInput](docs/FeeUpdateInput.md) - [LagoAPI::FeeUpdateInputFee](docs/FeeUpdateInputFee.md) - [LagoAPI::Fees](docs/Fees.md) - [LagoAPI::FeesPaginated](docs/FeesPaginated.md) - [LagoAPI::GenerateCustomerCheckoutURL200Response](docs/GenerateCustomerCheckoutURL200Response.md) + - [LagoAPI::GenerateCustomerCheckoutURL200ResponseCustomer](docs/GenerateCustomerCheckoutURL200ResponseCustomer.md) - [LagoAPI::GetCustomerPortalUrl200Response](docs/GetCustomerPortalUrl200Response.md) - [LagoAPI::GetCustomerPortalUrl200ResponseCustomer](docs/GetCustomerPortalUrl200ResponseCustomer.md) - [LagoAPI::GrossRevenueObject](docs/GrossRevenueObject.md) @@ -287,6 +292,8 @@ Class | Method | HTTP request | Description - [LagoAPI::GroupsPaginated](docs/GroupsPaginated.md) - [LagoAPI::Invoice](docs/Invoice.md) - [LagoAPI::InvoiceAppliedTaxObject](docs/InvoiceAppliedTaxObject.md) + - [LagoAPI::InvoiceCollectionObject](docs/InvoiceCollectionObject.md) + - [LagoAPI::InvoiceCollections](docs/InvoiceCollections.md) - [LagoAPI::InvoiceMetadataObject](docs/InvoiceMetadataObject.md) - [LagoAPI::InvoiceObject](docs/InvoiceObject.md) - [LagoAPI::InvoiceObjectCustomer](docs/InvoiceObjectCustomer.md) @@ -307,8 +314,6 @@ Class | Method | HTTP request | Description - [LagoAPI::OrganizationObject](docs/OrganizationObject.md) - [LagoAPI::OrganizationUpdateInput](docs/OrganizationUpdateInput.md) - [LagoAPI::OrganizationUpdateInputOrganization](docs/OrganizationUpdateInputOrganization.md) - - [LagoAPI::OutstandingInvoiceObject](docs/OutstandingInvoiceObject.md) - - [LagoAPI::OutstandingInvoices](docs/OutstandingInvoices.md) - [LagoAPI::PaginationMeta](docs/PaginationMeta.md) - [LagoAPI::Plan](docs/Plan.md) - [LagoAPI::PlanCreateInput](docs/PlanCreateInput.md) @@ -341,7 +346,9 @@ Class | Method | HTTP request | Description - [LagoAPI::Wallet](docs/Wallet.md) - [LagoAPI::WalletCreateInput](docs/WalletCreateInput.md) - [LagoAPI::WalletCreateInputWallet](docs/WalletCreateInputWallet.md) + - [LagoAPI::WalletCreateInputWalletRecurringTransactionRulesInner](docs/WalletCreateInputWalletRecurringTransactionRulesInner.md) - [LagoAPI::WalletObject](docs/WalletObject.md) + - [LagoAPI::WalletObjectRecurringTransactionRulesInner](docs/WalletObjectRecurringTransactionRulesInner.md) - [LagoAPI::WalletTransactionCreateInput](docs/WalletTransactionCreateInput.md) - [LagoAPI::WalletTransactionCreateInputWalletTransaction](docs/WalletTransactionCreateInputWalletTransaction.md) - [LagoAPI::WalletTransactionObject](docs/WalletTransactionObject.md) @@ -349,6 +356,7 @@ Class | Method | HTTP request | Description - [LagoAPI::WalletTransactionsPaginated](docs/WalletTransactionsPaginated.md) - [LagoAPI::WalletUpdateInput](docs/WalletUpdateInput.md) - [LagoAPI::WalletUpdateInputWallet](docs/WalletUpdateInputWallet.md) + - [LagoAPI::WalletUpdateInputWalletRecurringTransactionRulesInner](docs/WalletUpdateInputWalletRecurringTransactionRulesInner.md) - [LagoAPI::WalletsPaginated](docs/WalletsPaginated.md) - [LagoAPI::WebhookEndpoint](docs/WebhookEndpoint.md) - [LagoAPI::WebhookEndpointCreateInput](docs/WebhookEndpointCreateInput.md) diff --git a/ruby/docs/AnalyticsApi.md b/ruby/docs/AnalyticsApi.md index a55c7d4..1880f37 100644 --- a/ruby/docs/AnalyticsApi.md +++ b/ruby/docs/AnalyticsApi.md @@ -5,9 +5,9 @@ All URIs are relative to *https://api.getlago.com/api/v1* | Method | HTTP request | Description | | ------ | ------------ | ----------- | | [**find_all_gross_revenues**](AnalyticsApi.md#find_all_gross_revenues) | **GET** /analytics/gross_revenue | List gross revenue | +| [**find_all_invoice_collections**](AnalyticsApi.md#find_all_invoice_collections) | **GET** /analytics/invoice_collection | List of finalized invoices | | [**find_all_invoiced_usages**](AnalyticsApi.md#find_all_invoiced_usages) | **GET** /analytics/invoiced_usage | List usage revenue | | [**find_all_mrrs**](AnalyticsApi.md#find_all_mrrs) | **GET** /analytics/mrr | List MRR | -| [**find_all_outstanding_invoices**](AnalyticsApi.md#find_all_outstanding_invoices) | **GET** /analytics/outstanding_invoices | List outstanding invoices | ## find_all_gross_revenues @@ -83,13 +83,13 @@ end - **Accept**: application/json -## find_all_invoiced_usages +## find_all_invoice_collections -> find_all_invoiced_usages(opts) +> find_all_invoice_collections(opts) -List usage revenue +List of finalized invoices -Reports a monthly analysis focused on the revenue generated from all usage-based fees. It exclusively accounts for revenue that has been formally invoiced. Importantly, this report does not include revenue related to the usage in the current billing period, limiting its scope to previously invoiced amounts. +Represents a monthly aggregation, detailing both the total count and the cumulative amount of invoices that have been marked as `finalized`. This report sorts invoices categorically based on their `payment_status`. ### Examples @@ -104,33 +104,33 @@ end api_instance = LagoAPI::AnalyticsApi.new opts = { - currency: LagoAPI::Currency::AED # Currency | The currency of invoiced usage analytics. Format must be ISO 4217. + currency: LagoAPI::Currency::AED # Currency | The currency of revenue analytics. Format must be ISO 4217. } begin - # List usage revenue - result = api_instance.find_all_invoiced_usages(opts) + # List of finalized invoices + result = api_instance.find_all_invoice_collections(opts) p result rescue LagoAPI::ApiError => e - puts "Error when calling AnalyticsApi->find_all_invoiced_usages: #{e}" + puts "Error when calling AnalyticsApi->find_all_invoice_collections: #{e}" end ``` -#### Using the find_all_invoiced_usages_with_http_info variant +#### Using the find_all_invoice_collections_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> find_all_invoiced_usages_with_http_info(opts) +> , Integer, Hash)> find_all_invoice_collections_with_http_info(opts) ```ruby begin - # List usage revenue - data, status_code, headers = api_instance.find_all_invoiced_usages_with_http_info(opts) + # List of finalized invoices + data, status_code, headers = api_instance.find_all_invoice_collections_with_http_info(opts) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue LagoAPI::ApiError => e - puts "Error when calling AnalyticsApi->find_all_invoiced_usages_with_http_info: #{e}" + puts "Error when calling AnalyticsApi->find_all_invoice_collections_with_http_info: #{e}" end ``` @@ -138,11 +138,11 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **currency** | [**Currency**](.md) | The currency of invoiced usage analytics. Format must be ISO 4217. | [optional] | +| **currency** | [**Currency**](.md) | The currency of revenue analytics. Format must be ISO 4217. | [optional] | ### Return type -[**InvoicedUsages**](InvoicedUsages.md) +[**InvoiceCollections**](InvoiceCollections.md) ### Authorization @@ -154,13 +154,13 @@ end - **Accept**: application/json -## find_all_mrrs +## find_all_invoiced_usages -> find_all_mrrs(opts) +> find_all_invoiced_usages(opts) -List MRR +List usage revenue -This endpoint is used to list MRR. +Reports a monthly analysis focused on the revenue generated from all usage-based fees. It exclusively accounts for revenue that has been formally invoiced. Importantly, this report does not include revenue related to the usage in the current billing period, limiting its scope to previously invoiced amounts. ### Examples @@ -175,34 +175,33 @@ end api_instance = LagoAPI::AnalyticsApi.new opts = { - currency: LagoAPI::Currency::AED, # Currency | Quantifies the revenue generated from `subscription` fees on a monthly basis. This figure is calculated post-application of applicable taxes and prior to the deduction of any applicable discounts. The method of calculation varies based on the subscription billing cycle: - Revenue from `monthly` subscription invoices is included in the MRR for the month in which the invoice is issued. - Revenue from `quarterly` subscription invoices is distributed evenly over three months. This distribution applies to fees paid in advance (allocated to the next three months) as well as to fees paid in arrears (allocated to the preceding three months). - Revenue from `yearly` subscription invoices is distributed evenly over twelve months. This allocation is applicable for fees paid in advance (spread over the next twelve months) and for fees paid in arrears (spread over the previous twelve months). - Revenue from `weekly` subscription invoices, the total revenue from all invoices issued within a month is summed up. This total is then divided by the number of invoices issued during that month, and the result is multiplied by 4.33, representing the average number of weeks in a month. - months: 12 # Integer | Show data only for given number of months. + currency: LagoAPI::Currency::AED # Currency | The currency of invoiced usage analytics. Format must be ISO 4217. } begin - # List MRR - result = api_instance.find_all_mrrs(opts) + # List usage revenue + result = api_instance.find_all_invoiced_usages(opts) p result rescue LagoAPI::ApiError => e - puts "Error when calling AnalyticsApi->find_all_mrrs: #{e}" + puts "Error when calling AnalyticsApi->find_all_invoiced_usages: #{e}" end ``` -#### Using the find_all_mrrs_with_http_info variant +#### Using the find_all_invoiced_usages_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> find_all_mrrs_with_http_info(opts) +> , Integer, Hash)> find_all_invoiced_usages_with_http_info(opts) ```ruby begin - # List MRR - data, status_code, headers = api_instance.find_all_mrrs_with_http_info(opts) + # List usage revenue + data, status_code, headers = api_instance.find_all_invoiced_usages_with_http_info(opts) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue LagoAPI::ApiError => e - puts "Error when calling AnalyticsApi->find_all_mrrs_with_http_info: #{e}" + puts "Error when calling AnalyticsApi->find_all_invoiced_usages_with_http_info: #{e}" end ``` @@ -210,12 +209,11 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **currency** | [**Currency**](.md) | Quantifies the revenue generated from `subscription` fees on a monthly basis. This figure is calculated post-application of applicable taxes and prior to the deduction of any applicable discounts. The method of calculation varies based on the subscription billing cycle: - Revenue from `monthly` subscription invoices is included in the MRR for the month in which the invoice is issued. - Revenue from `quarterly` subscription invoices is distributed evenly over three months. This distribution applies to fees paid in advance (allocated to the next three months) as well as to fees paid in arrears (allocated to the preceding three months). - Revenue from `yearly` subscription invoices is distributed evenly over twelve months. This allocation is applicable for fees paid in advance (spread over the next twelve months) and for fees paid in arrears (spread over the previous twelve months). - Revenue from `weekly` subscription invoices, the total revenue from all invoices issued within a month is summed up. This total is then divided by the number of invoices issued during that month, and the result is multiplied by 4.33, representing the average number of weeks in a month. | [optional] | -| **months** | **Integer** | Show data only for given number of months. | [optional] | +| **currency** | [**Currency**](.md) | The currency of invoiced usage analytics. Format must be ISO 4217. | [optional] | ### Return type -[**Mrrs**](Mrrs.md) +[**InvoicedUsages**](InvoicedUsages.md) ### Authorization @@ -227,13 +225,13 @@ end - **Accept**: application/json -## find_all_outstanding_invoices +## find_all_mrrs -> find_all_outstanding_invoices(opts) +> find_all_mrrs(opts) -List outstanding invoices +List MRR -Represents a monthly aggregation, detailing both the total count and the cumulative amount of invoices that have been marked as `finalized`. This report sorts invoices categorically based on their `payment_status`. +This endpoint is used to list MRR. ### Examples @@ -248,33 +246,34 @@ end api_instance = LagoAPI::AnalyticsApi.new opts = { - currency: LagoAPI::Currency::AED # Currency | The currency of revenue analytics. Format must be ISO 4217. + currency: LagoAPI::Currency::AED, # Currency | Quantifies the revenue generated from `subscription` fees on a monthly basis. This figure is calculated post-application of applicable taxes and deduction of any applicable discounts. The method of calculation varies based on the subscription billing cycle: - Revenue from `monthly` subscription invoices is included in the MRR for the month in which the invoice is issued. - Revenue from `quarterly` subscription invoices is distributed evenly over three months. This distribution applies to fees paid in advance (allocated to the next remaining months depending on calendar or anniversary billing) as well as to fees paid in arrears (allocated to the preceding months depending on calendar or anniversary billing). - Revenue from `yearly` subscription invoices is distributed evenly over twelve months. This allocation is applicable for fees paid in advance (spread over the next remaining months depending on calendar or anniversary billing) and for fees paid in arrears (spread over the previous months depending on calendar or anniversary billing). - Revenue from `weekly` subscription invoices, the total revenue from all invoices issued within a month is summed up. This total is then divided by the number of invoices issued during that month, and the result is multiplied by 4.33, representing the average number of weeks in a month. + months: 12 # Integer | Show data only for given number of months. } begin - # List outstanding invoices - result = api_instance.find_all_outstanding_invoices(opts) + # List MRR + result = api_instance.find_all_mrrs(opts) p result rescue LagoAPI::ApiError => e - puts "Error when calling AnalyticsApi->find_all_outstanding_invoices: #{e}" + puts "Error when calling AnalyticsApi->find_all_mrrs: #{e}" end ``` -#### Using the find_all_outstanding_invoices_with_http_info variant +#### Using the find_all_mrrs_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> find_all_outstanding_invoices_with_http_info(opts) +> , Integer, Hash)> find_all_mrrs_with_http_info(opts) ```ruby begin - # List outstanding invoices - data, status_code, headers = api_instance.find_all_outstanding_invoices_with_http_info(opts) + # List MRR + data, status_code, headers = api_instance.find_all_mrrs_with_http_info(opts) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue LagoAPI::ApiError => e - puts "Error when calling AnalyticsApi->find_all_outstanding_invoices_with_http_info: #{e}" + puts "Error when calling AnalyticsApi->find_all_mrrs_with_http_info: #{e}" end ``` @@ -282,11 +281,12 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **currency** | [**Currency**](.md) | The currency of revenue analytics. Format must be ISO 4217. | [optional] | +| **currency** | [**Currency**](.md) | Quantifies the revenue generated from `subscription` fees on a monthly basis. This figure is calculated post-application of applicable taxes and deduction of any applicable discounts. The method of calculation varies based on the subscription billing cycle: - Revenue from `monthly` subscription invoices is included in the MRR for the month in which the invoice is issued. - Revenue from `quarterly` subscription invoices is distributed evenly over three months. This distribution applies to fees paid in advance (allocated to the next remaining months depending on calendar or anniversary billing) as well as to fees paid in arrears (allocated to the preceding months depending on calendar or anniversary billing). - Revenue from `yearly` subscription invoices is distributed evenly over twelve months. This allocation is applicable for fees paid in advance (spread over the next remaining months depending on calendar or anniversary billing) and for fees paid in arrears (spread over the previous months depending on calendar or anniversary billing). - Revenue from `weekly` subscription invoices, the total revenue from all invoices issued within a month is summed up. This total is then divided by the number of invoices issued during that month, and the result is multiplied by 4.33, representing the average number of weeks in a month. | [optional] | +| **months** | **Integer** | Show data only for given number of months. | [optional] | ### Return type -[**OutstandingInvoices**](OutstandingInvoices.md) +[**Mrrs**](Mrrs.md) ### Authorization diff --git a/ruby/docs/ChargeObjectProperties.md b/ruby/docs/ChargeObjectProperties.md index 9fb6974..2c7e3b2 100644 --- a/ruby/docs/ChargeObjectProperties.md +++ b/ruby/docs/ChargeObjectProperties.md @@ -15,6 +15,7 @@ | **free_units_per_total_aggregation** | **String** | The transaction amount that is not impacted by the `percentage` rate and fixed fee in a percentage charge model. This field indicates the portion of the transaction amount that is exempt from the calculation of charges based on the specified percentage rate and fixed fee. | [optional] | | **per_transaction_max_amount** | **String** | Specifies the maximum allowable spending for a single transaction. Working as a transaction cap. | [optional] | | **per_transaction_min_amount** | **String** | Specifies the minimum allowable spending for a single transaction. Working as a transaction floor. | [optional] | +| **grouped_by** | **Array<String>** | The list of event properties that are used to group the events on the invoice for a `standard` charge model. | [optional] | | **volume_ranges** | [**Array<ChargePropertiesVolumeRangesInner>**](ChargePropertiesVolumeRangesInner.md) | Volume ranges, sorted from bottom to top tiers, used for a `volume` charge model. | [optional] | ## Example @@ -34,6 +35,7 @@ instance = LagoAPI::ChargeObjectProperties.new( free_units_per_total_aggregation: 500, per_transaction_max_amount: 3.75, per_transaction_min_amount: 1.75, + grouped_by: [agent_name], volume_ranges: null ) ``` diff --git a/ruby/docs/ChargeProperties.md b/ruby/docs/ChargeProperties.md index 5b8b21e..1834535 100644 --- a/ruby/docs/ChargeProperties.md +++ b/ruby/docs/ChargeProperties.md @@ -15,6 +15,7 @@ | **free_units_per_total_aggregation** | **String** | The transaction amount that is not impacted by the `percentage` rate and fixed fee in a percentage charge model. This field indicates the portion of the transaction amount that is exempt from the calculation of charges based on the specified percentage rate and fixed fee. | [optional] | | **per_transaction_max_amount** | **String** | Specifies the maximum allowable spending for a single transaction. Working as a transaction cap. | [optional] | | **per_transaction_min_amount** | **String** | Specifies the minimum allowable spending for a single transaction. Working as a transaction floor. | [optional] | +| **grouped_by** | **Array<String>** | The list of event properties that are used to group the events on the invoice for a `standard` charge model. | [optional] | | **volume_ranges** | [**Array<ChargePropertiesVolumeRangesInner>**](ChargePropertiesVolumeRangesInner.md) | Volume ranges, sorted from bottom to top tiers, used for a `volume` charge model. | [optional] | ## Example @@ -34,6 +35,7 @@ instance = LagoAPI::ChargeProperties.new( free_units_per_total_aggregation: 500, per_transaction_max_amount: 3.75, per_transaction_min_amount: 1.75, + grouped_by: ["agent_name"], volume_ranges: null ) ``` diff --git a/ruby/docs/CreditNoteItemObjectFee.md b/ruby/docs/CreditNoteItemObjectFee.md index 83011ad..cee3e7a 100644 --- a/ruby/docs/CreditNoteItemObjectFee.md +++ b/ruby/docs/CreditNoteItemObjectFee.md @@ -33,6 +33,7 @@ | **failed_at** | **Time** | The date and time when the payment for the fee failed to process. It is provided in Coordinated Universal Time (UTC) format. | [optional] | | **refunded_at** | **Time** | The date and time when the payment for the fee was refunded. It is provided in Coordinated Universal Time (UTC) format | [optional] | | **event_transaction_id** | **String** | Unique identifier assigned to the transaction. This field is specifically displayed when the fee type is `charge` and the payment for the fee is made in advance (`pay_in_advance` is set to `true`). | [optional] | +| **amount_details** | [**FeeObjectAmountDetails**](FeeObjectAmountDetails.md) | | [optional] | | **item** | [**FeeObjectItem**](FeeObjectItem.md) | | | | **applied_taxes** | [**Array<FeeAppliedTaxObject>**](FeeAppliedTaxObject.md) | List of fee applied taxes | [optional] | @@ -71,6 +72,7 @@ instance = LagoAPI::CreditNoteItemObjectFee.new( failed_at: 2022-08-24T14:58:59Z, refunded_at: 2022-08-24T14:58:59Z, event_transaction_id: transaction_1234567890, + amount_details: null, item: null, applied_taxes: null ) diff --git a/ruby/docs/CustomerBillingConfiguration.md b/ruby/docs/CustomerBillingConfiguration.md index b7c8c65..091fa62 100644 --- a/ruby/docs/CustomerBillingConfiguration.md +++ b/ruby/docs/CustomerBillingConfiguration.md @@ -6,6 +6,7 @@ | ---- | ---- | ----------- | ----- | | **invoice_grace_period** | **Integer** | The grace period, expressed in days, for the invoice. This period refers to the additional time granted to the customer beyond the invoice due date to adjust usage and line items | [optional] | | **payment_provider** | **String** | The payment provider utilized to initiate payments for invoices issued by Lago. Accepted values: `stripe`, `adyen`, `gocardless` or null. This field is required if you intend to assign a `provider_customer_id`. | [optional] | +| **payment_provider_code** | **String** | Unique code used to identify a payment provider connection. | [optional] | | **provider_customer_id** | **String** | The customer ID within the payment provider's system. If this field is not provided, Lago has the option to create a new customer record within the payment provider's system on behalf of the customer | [optional] | | **sync** | **Boolean** | Set this field to `true` if you want to create the customer in the payment provider synchronously with the customer creation process in Lago. This option is applicable only when the `provider_customer_id` is `null` and the customer is automatically created in the payment provider through Lago. By default, the value is set to `false` | [optional] | | **sync_with_provider** | **Boolean** | Set this field to `true` if you want to create a customer record in the payment provider's system. This option is applicable only when the `provider_customer_id` is null and the `sync_with_provider` field is set to `true`. By default, the value is set to `false` | [optional] | @@ -20,6 +21,7 @@ require 'lago_ruby' instance = LagoAPI::CustomerBillingConfiguration.new( invoice_grace_period: 3, payment_provider: stripe, + payment_provider_code: stripe-eu-1, provider_customer_id: cus_12345, sync: true, sync_with_provider: true, diff --git a/ruby/docs/CustomerChargeGroupedUsageObjectInner.md b/ruby/docs/CustomerChargeGroupedUsageObjectInner.md new file mode 100644 index 0000000..e067c13 --- /dev/null +++ b/ruby/docs/CustomerChargeGroupedUsageObjectInner.md @@ -0,0 +1,26 @@ +# LagoAPI::CustomerChargeGroupedUsageObjectInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **amount_cents** | **Integer** | The amount in cents, tax excluded, consumed for a specific group related to a charge item. | [optional] | +| **events_count** | **Integer** | The quantity of usage events that have been recorded for a particular charge during the specified time period. These events may also be referred to as the number of transactions in some contexts. | [optional] | +| **units** | **String** | The number of units consumed for a specific group related to a charge item. | [optional] | +| **grouped_by** | **Hash<String, String>** | Key value list of event properties aggregated by the charge model | [optional] | +| **groups** | [**Array<CustomerChargeGroupsUsageObjectInner>**](CustomerChargeGroupsUsageObjectInner.md) | Array of group object, representing multiple dimensions for a charge item. | [optional] | + +## Example + +```ruby +require 'lago_ruby' + +instance = LagoAPI::CustomerChargeGroupedUsageObjectInner.new( + amount_cents: 1000, + events_count: 10, + units: 0.9, + grouped_by: null, + groups: null +) +``` + diff --git a/ruby/docs/CustomerChargeGroupsUsageObjectInner.md b/ruby/docs/CustomerChargeGroupsUsageObjectInner.md new file mode 100644 index 0000000..6b30c72 --- /dev/null +++ b/ruby/docs/CustomerChargeGroupsUsageObjectInner.md @@ -0,0 +1,28 @@ +# LagoAPI::CustomerChargeGroupsUsageObjectInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **lago_id** | **String** | Unique identifier assigned to the group within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the group record within the Lago system. | [optional] | +| **key** | **String** | The group key, only returned for groups with two dimensions. | [optional] | +| **value** | **String** | The group value. | [optional] | +| **units** | **String** | The number of units consumed for a specific group related to a charge item. | [optional] | +| **events_count** | **Integer** | The quantity of usage events that have been recorded for a particular charge during the specified time period. These events may also be referred to as the number of transactions in some contexts. | [optional] | +| **amount_cents** | **Integer** | The amount in cents, tax excluded, consumed for a specific group related to a charge item. | [optional] | + +## Example + +```ruby +require 'lago_ruby' + +instance = LagoAPI::CustomerChargeGroupsUsageObjectInner.new( + lago_id: 1a901a90-1a90-1a90-1a90-1a901a901a90, + key: null, + value: europe, + units: 0.9, + events_count: 10, + amount_cents: 1000 +) +``` + diff --git a/ruby/docs/CustomerChargeUsageObject.md b/ruby/docs/CustomerChargeUsageObject.md index e7c425f..7a26c14 100644 --- a/ruby/docs/CustomerChargeUsageObject.md +++ b/ruby/docs/CustomerChargeUsageObject.md @@ -10,7 +10,8 @@ | **amount_currency** | [**Currency**](Currency.md) | | | | **charge** | [**CustomerChargeUsageObjectCharge**](CustomerChargeUsageObjectCharge.md) | | | | **billable_metric** | [**CustomerChargeUsageObjectBillableMetric**](CustomerChargeUsageObjectBillableMetric.md) | | | -| **groups** | [**Array<CustomerChargeUsageObjectGroupsInner>**](CustomerChargeUsageObjectGroupsInner.md) | Array of group object, representing multiple dimensions for a charge item. | | +| **groups** | [**Array<CustomerChargeGroupsUsageObjectInner>**](CustomerChargeGroupsUsageObjectInner.md) | Array of group object, representing multiple dimensions for a charge item. | | +| **grouped_usage** | [**Array<CustomerChargeGroupedUsageObjectInner>**](CustomerChargeGroupedUsageObjectInner.md) | Array of aggregated fees, grouped by the event properties defined in a `standard` charge model. | [optional] | ## Example @@ -24,7 +25,8 @@ instance = LagoAPI::CustomerChargeUsageObject.new( amount_currency: null, charge: null, billable_metric: null, - groups: null + groups: null, + grouped_usage: null ) ``` diff --git a/ruby/docs/EventBatchInput.md b/ruby/docs/EventBatchInput.md index 2d71325..2bc39ad 100644 --- a/ruby/docs/EventBatchInput.md +++ b/ruby/docs/EventBatchInput.md @@ -4,7 +4,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **event** | [**EventBatchInputEvent**](EventBatchInputEvent.md) | | | +| **events** | [**Array<EventInput>**](EventInput.md) | | | ## Example @@ -12,7 +12,7 @@ require 'lago_ruby' instance = LagoAPI::EventBatchInput.new( - event: null + events: null ) ``` diff --git a/ruby/docs/EventsApi.md b/ruby/docs/EventsApi.md index 4249d06..21cdc2f 100644 --- a/ruby/docs/EventsApi.md +++ b/ruby/docs/EventsApi.md @@ -16,7 +16,7 @@ All URIs are relative to *https://api.getlago.com/api/v1* Batch multiple events -This endpoint is used for transmitting a batch of usage measurement events to multiple subscriptions for a single customer. +This endpoint is used to send a batch of usage records. ### Examples @@ -30,7 +30,7 @@ LagoAPI.configure do |config| end api_instance = LagoAPI::EventsApi.new -event_batch_input = LagoAPI::EventBatchInput.new({event: LagoAPI::EventBatchInputEvent.new({transaction_id: 'transaction_1234567890', external_subscription_ids: ["sub_1234567890", "sub_0987654321"], code: 'storage'})}) # EventBatchInput | Batch events payload +event_batch_input = LagoAPI::EventBatchInput.new({events: [LagoAPI::EventInput.new({event: LagoAPI::EventInputEvent.new({transaction_id: 'transaction_1234567890', code: 'storage'})})]}) # EventBatchInput | Batch events payload begin # Batch multiple events diff --git a/ruby/docs/FeeObject.md b/ruby/docs/FeeObject.md index 90299a1..f8947cd 100644 --- a/ruby/docs/FeeObject.md +++ b/ruby/docs/FeeObject.md @@ -33,6 +33,7 @@ | **failed_at** | **Time** | The date and time when the payment for the fee failed to process. It is provided in Coordinated Universal Time (UTC) format. | [optional] | | **refunded_at** | **Time** | The date and time when the payment for the fee was refunded. It is provided in Coordinated Universal Time (UTC) format | [optional] | | **event_transaction_id** | **String** | Unique identifier assigned to the transaction. This field is specifically displayed when the fee type is `charge` and the payment for the fee is made in advance (`pay_in_advance` is set to `true`). | [optional] | +| **amount_details** | [**FeeObjectAmountDetails**](FeeObjectAmountDetails.md) | | [optional] | | **item** | [**FeeObjectItem**](FeeObjectItem.md) | | | | **applied_taxes** | [**Array<FeeAppliedTaxObject>**](FeeAppliedTaxObject.md) | List of fee applied taxes | [optional] | @@ -71,6 +72,7 @@ instance = LagoAPI::FeeObject.new( failed_at: 2022-08-24T14:58:59Z, refunded_at: 2022-08-24T14:58:59Z, event_transaction_id: transaction_1234567890, + amount_details: null, item: null, applied_taxes: null ) diff --git a/ruby/docs/FeeObjectAmountDetails.md b/ruby/docs/FeeObjectAmountDetails.md new file mode 100644 index 0000000..40c5e42 --- /dev/null +++ b/ruby/docs/FeeObjectAmountDetails.md @@ -0,0 +1,46 @@ +# LagoAPI::FeeObjectAmountDetails + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **graduated_ranges** | [**Array<FeeObjectAmountDetailsAllOfGraduatedRangesInner>**](FeeObjectAmountDetailsAllOfGraduatedRangesInner.md) | Graduated ranges, used for a `graduated` charge model. | [optional] | +| **graduated_percentage_ranges** | [**Array<FeeObjectAmountDetailsAllOfGraduatedPercentageRangesInner>**](FeeObjectAmountDetailsAllOfGraduatedPercentageRangesInner.md) | Graduated percentage ranges, used for a `graduated_percentage` charge model. | [optional] | +| **free_units** | **String** | The quantity of units that are provided free of charge for each billing period in a `package` charge model. | [optional] | +| **paid_units** | **String** | The quantity of units that are not provided free of charge for each billing period in a `package` charge model. | [optional] | +| **per_package_size** | **Integer** | The quantity of units included, defined for Package or Percentage charge model. | [optional] | +| **per_package_unit_amount** | **String** | Total amount to charge for received paid_units, defined for Package or Percentage charge model. | [optional] | +| **units** | **String** | The total units received in Lago for the Percentage charge model. | [optional] | +| **free_events** | **Integer** | Total number of free events allowed for the Percentage charge model. | [optional] | +| **rate** | **String** | Percentage rate applied for the Percentage charge model. | [optional] | +| **per_unit_total_amount** | **String** | Total amount of received units to be charged for the Percentage charge model. | [optional] | +| **paid_events** | **Integer** | Total number of paid events for the Percentage charge model. | [optional] | +| **fixed_fee_unit_amount** | **String** | Fixed fee unit price per received paid_event for the Percentage charge model. | [optional] | +| **fixed_fee_total_amount** | **String** | Total amount to charge for received paid_events for the Percentage charge model. | [optional] | +| **min_max_adjustment_total_amount** | **String** | Total adjustment amount linked to minimum and maximum spending per transaction for the Percentage charge model. | [optional] | +| **volume_ranges** | [**Array<FeeObjectAmountDetailsAllOfVolumeRangesInner>**](FeeObjectAmountDetailsAllOfVolumeRangesInner.md) | Volume ranges, used for a `volume` charge model. | [optional] | + +## Example + +```ruby +require 'lago_ruby' + +instance = LagoAPI::FeeObjectAmountDetails.new( + graduated_ranges: null, + graduated_percentage_ranges: null, + free_units: 10.0, + paid_units: 40.0, + per_package_size: 1000, + per_package_unit_amount: 0.5, + units: 20.0, + free_events: 10, + rate: 1.0, + per_unit_total_amount: 10.0, + paid_events: 20, + fixed_fee_unit_amount: 1.0, + fixed_fee_total_amount: 20.0, + min_max_adjustment_total_amount: 20.0, + volume_ranges: null +) +``` + diff --git a/ruby/docs/FeeObjectAmountDetailsAllOfGraduatedPercentageRangesInner.md b/ruby/docs/FeeObjectAmountDetailsAllOfGraduatedPercentageRangesInner.md new file mode 100644 index 0000000..8a0fa84 --- /dev/null +++ b/ruby/docs/FeeObjectAmountDetailsAllOfGraduatedPercentageRangesInner.md @@ -0,0 +1,30 @@ +# LagoAPI::FeeObjectAmountDetailsAllOfGraduatedPercentageRangesInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **units** | **String** | Total units received in Lago. | | +| **from_value** | **Integer** | Lower value of a tier. It is either 0 or the previous range's `to_value + 1`. | | +| **to_value** | **Integer** | Highest value of a tier. - This value is higher than the from_value of the same tier. - This value is null for the last tier. | | +| **flat_unit_amount** | **String** | Flat unit amount within a specified tier. | | +| **rate** | **String** | Percentage rate applied within a specified tier. | | +| **per_unit_total_amount** | **String** | Total amount of received units to be charged within a specified tier. | | +| **total_with_flat_amount** | **String** | Total amount to be charged for a specific tier, taking into account the flat_unit_amount and the per_unit_total_amount. | | + +## Example + +```ruby +require 'lago_ruby' + +instance = LagoAPI::FeeObjectAmountDetailsAllOfGraduatedPercentageRangesInner.new( + units: 10.0, + from_value: 0, + to_value: 10, + flat_unit_amount: 1.0, + rate: 1.0, + per_unit_total_amount: 10.0, + total_with_flat_amount: 11.0 +) +``` + diff --git a/ruby/docs/FeeObjectAmountDetailsAllOfGraduatedRangesInner.md b/ruby/docs/FeeObjectAmountDetailsAllOfGraduatedRangesInner.md new file mode 100644 index 0000000..d127f7f --- /dev/null +++ b/ruby/docs/FeeObjectAmountDetailsAllOfGraduatedRangesInner.md @@ -0,0 +1,30 @@ +# LagoAPI::FeeObjectAmountDetailsAllOfGraduatedRangesInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **units** | **String** | Total units received in Lago. | | +| **from_value** | **Integer** | Lower value of a tier. It is either 0 or the previous range's `to_value + 1`. | | +| **to_value** | **Integer** | Highest value of a tier. - This value is higher than the from_value of the same tier. - This value is null for the last tier. | | +| **flat_unit_amount** | **String** | Flat unit amount within a specified tier. | | +| **per_unit_amount** | **String** | Amount per unit within a specified tier. | | +| **per_unit_total_amount** | **String** | Total amount of received units to be charged within a specified tier. | | +| **total_with_flat_amount** | **String** | Total amount to be charged for a specific tier, taking into account the flat_unit_amount and the per_unit_total_amount. | | + +## Example + +```ruby +require 'lago_ruby' + +instance = LagoAPI::FeeObjectAmountDetailsAllOfGraduatedRangesInner.new( + units: 10.0, + from_value: 0, + to_value: 10, + flat_unit_amount: 1.0, + per_unit_amount: 1.0, + per_unit_total_amount: 10.0, + total_with_flat_amount: 11.0 +) +``` + diff --git a/ruby/docs/FeeObjectAmountDetailsAllOfVolumeRangesInner.md b/ruby/docs/FeeObjectAmountDetailsAllOfVolumeRangesInner.md new file mode 100644 index 0000000..4b4ed72 --- /dev/null +++ b/ruby/docs/FeeObjectAmountDetailsAllOfVolumeRangesInner.md @@ -0,0 +1,22 @@ +# LagoAPI::FeeObjectAmountDetailsAllOfVolumeRangesInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **per_unit_amount** | **String** | The flat amount for a whole tier, excluding tax, for a `volume` charge model. | | +| **flat_unit_amount** | **String** | The unit price, excluding tax, for a specific tier of a `volume` charge model. | | +| **per_unit_total_amount** | **String** | Total amount of received units to be charged. | | + +## Example + +```ruby +require 'lago_ruby' + +instance = LagoAPI::FeeObjectAmountDetailsAllOfVolumeRangesInner.new( + per_unit_amount: 0.5, + flat_unit_amount: 10.0, + per_unit_total_amount: 10.0 +) +``` + diff --git a/ruby/docs/FeeObjectItem.md b/ruby/docs/FeeObjectItem.md index bbdf177..9796904 100644 --- a/ruby/docs/FeeObjectItem.md +++ b/ruby/docs/FeeObjectItem.md @@ -11,6 +11,7 @@ | **group_invoice_display_name** | **String** | Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the actual charge will be used as the default display name. | [optional] | | **lago_item_id** | **String** | Unique identifier of the fee item, created by Lago. It can be the identifier of the `add-on`, the identifier of the `charge`, the identifier of the `credit` or the identifier of the `subscription`. | | | **item_type** | **String** | The type of the fee item. Possible values are `AddOn`, `BillableMetric`, `WalletTransaction` or `Subscription`. | | +| **grouped_by** | **Hash<String, String>** | Key value list of event properties aggregated by the charge model | [optional] | ## Example @@ -24,7 +25,8 @@ instance = LagoAPI::FeeObjectItem.new( invoice_display_name: Setup Fee (SF1), group_invoice_display_name: Transactions - ACH, lago_item_id: 1a901a90-1a90-1a90-1a90-1a901a901a90, - item_type: Subscription + item_type: Subscription, + grouped_by: null ) ``` diff --git a/ruby/docs/GenerateCustomerCheckoutURL200Response.md b/ruby/docs/GenerateCustomerCheckoutURL200Response.md index 13dc1ad..185e951 100644 --- a/ruby/docs/GenerateCustomerCheckoutURL200Response.md +++ b/ruby/docs/GenerateCustomerCheckoutURL200Response.md @@ -4,10 +4,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **lago_customer_id** | **String** | Unique identifier assigned to the customer within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the customer's record within the Lago system | [optional] | -| **external_customer_id** | **String** | The customer external unique identifier (provided by your own application) | [optional] | -| **payment_provider** | **String** | The Payment Provider name linked to the Customer. | [optional] | -| **checkout_url** | **String** | The new generated Payment Provider Checkout URL for the Customer. | [optional] | +| **customer** | [**GenerateCustomerCheckoutURL200ResponseCustomer**](GenerateCustomerCheckoutURL200ResponseCustomer.md) | | [optional] | ## Example @@ -15,10 +12,7 @@ require 'lago_ruby' instance = LagoAPI::GenerateCustomerCheckoutURL200Response.new( - lago_customer_id: 1a901a90-1a90-1a90-1a90-1a901a901a90, - external_customer_id: 5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba, - payment_provider: stripe, - checkout_url: https://foo.bar + customer: null ) ``` diff --git a/ruby/docs/GenerateCustomerCheckoutURL200ResponseCustomer.md b/ruby/docs/GenerateCustomerCheckoutURL200ResponseCustomer.md new file mode 100644 index 0000000..6b153ae --- /dev/null +++ b/ruby/docs/GenerateCustomerCheckoutURL200ResponseCustomer.md @@ -0,0 +1,24 @@ +# LagoAPI::GenerateCustomerCheckoutURL200ResponseCustomer + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **lago_customer_id** | **String** | Unique identifier assigned to the customer within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the customer's record within the Lago system | [optional] | +| **external_customer_id** | **String** | The customer external unique identifier (provided by your own application) | [optional] | +| **payment_provider** | **String** | The Payment Provider name linked to the Customer. | [optional] | +| **checkout_url** | **String** | The new generated Payment Provider Checkout URL for the Customer. | [optional] | + +## Example + +```ruby +require 'lago_ruby' + +instance = LagoAPI::GenerateCustomerCheckoutURL200ResponseCustomer.new( + lago_customer_id: 1a901a90-1a90-1a90-1a90-1a901a901a90, + external_customer_id: 5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba, + payment_provider: stripe, + checkout_url: https://foo.bar +) +``` + diff --git a/ruby/docs/GroupPropertiesObjectValues.md b/ruby/docs/GroupPropertiesObjectValues.md index d5772be..a43765b 100644 --- a/ruby/docs/GroupPropertiesObjectValues.md +++ b/ruby/docs/GroupPropertiesObjectValues.md @@ -15,6 +15,7 @@ | **free_units_per_total_aggregation** | **String** | The transaction amount that is not impacted by the `percentage` rate and fixed fee in a percentage charge model. This field indicates the portion of the transaction amount that is exempt from the calculation of charges based on the specified percentage rate and fixed fee. | [optional] | | **per_transaction_max_amount** | **String** | Specifies the maximum allowable spending for a single transaction. Working as a transaction cap. | [optional] | | **per_transaction_min_amount** | **String** | Specifies the minimum allowable spending for a single transaction. Working as a transaction floor. | [optional] | +| **grouped_by** | **Array<String>** | The list of event properties that are used to group the events on the invoice for a `standard` charge model. | [optional] | | **volume_ranges** | [**Array<ChargePropertiesVolumeRangesInner>**](ChargePropertiesVolumeRangesInner.md) | Volume ranges, sorted from bottom to top tiers, used for a `volume` charge model. | [optional] | ## Example @@ -34,6 +35,7 @@ instance = LagoAPI::GroupPropertiesObjectValues.new( free_units_per_total_aggregation: 500, per_transaction_max_amount: 3.75, per_transaction_min_amount: 1.75, + grouped_by: [agent_name], volume_ranges: null ) ``` diff --git a/ruby/docs/InvoiceCollectionObject.md b/ruby/docs/InvoiceCollectionObject.md new file mode 100644 index 0000000..74043ce --- /dev/null +++ b/ruby/docs/InvoiceCollectionObject.md @@ -0,0 +1,26 @@ +# LagoAPI::InvoiceCollectionObject + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **month** | **String** | Identifies the month to analyze revenue. | | +| **payment_status** | **String** | The payment status of the invoices. | [optional] | +| **invoices_count** | **Integer** | Contains invoices count. | | +| **amount_cents** | **Integer** | The total amount of revenue for a period, expressed in cents. | | +| **currency** | [**Currency**](Currency.md) | | [optional] | + +## Example + +```ruby +require 'lago_ruby' + +instance = LagoAPI::InvoiceCollectionObject.new( + month: 2023-11-01T00:00:00.000Z, + payment_status: succeeded, + invoices_count: 10, + amount_cents: 50000, + currency: null +) +``` + diff --git a/ruby/docs/InvoiceCollections.md b/ruby/docs/InvoiceCollections.md new file mode 100644 index 0000000..b50ed5e --- /dev/null +++ b/ruby/docs/InvoiceCollections.md @@ -0,0 +1,18 @@ +# LagoAPI::InvoiceCollections + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **invoice_collections** | [**Array<InvoiceCollectionObject>**](InvoiceCollectionObject.md) | | | + +## Example + +```ruby +require 'lago_ruby' + +instance = LagoAPI::InvoiceCollections.new( + invoice_collections: null +) +``` + diff --git a/ruby/docs/InvoiceObject.md b/ruby/docs/InvoiceObject.md index 3beef8f..a3671f4 100644 --- a/ruby/docs/InvoiceObject.md +++ b/ruby/docs/InvoiceObject.md @@ -11,7 +11,7 @@ | **payment_due_date** | **Date** | The payment due date for the invoice, specified in the ISO 8601 date format. | [optional] | | **net_payment_term** | **Integer** | The net payment term, expressed in days, specifies the duration within which a customer is expected to remit payment after the invoice is finalized. | [optional] | | **invoice_type** | **String** | The type of invoice issued. Possible values are `subscription`, `one-off` or `credit`. | | -| **status** | **String** | The status of the invoice. It indicates the current state of the invoice and can have two possible values: - `draft`: the invoice is in the draft state, waiting for the end of the grace period to be finalized. During this period, events can still be ingested and added to the invoice. - `finalized`: the invoice has been issued and finalized. In this state, events cannot be ingested or added to the invoice anymore. | | +| **status** | **String** | The status of the invoice. It indicates the current state of the invoice and can have two possible values: - `draft`: the invoice is in the draft state, waiting for the end of the grace period to be finalized. During this period, events can still be ingested and added to the invoice. - `finalized`: the invoice has been issued and finalized. In this state, events cannot be ingested or added to the invoice anymore. - `voided`: the invoice has been issued and subsequently voided. In this state, events cannot be ingested or added to the invoice anymore. | | | **payment_status** | **String** | The status of the payment associated with the invoice. It can have one of the following values: - `pending`: the payment is pending, waiting for payment processing in Stripe or when the invoice is emitted but users have not updated the payment status through the endpoint. - `succeeded`: the payment of the invoice has been successfully processed. - `failed`: the payment of the invoice has failed or encountered an error during processing. | | | **currency** | [**Currency**](Currency.md) | | | | **fees_amount_cents** | **Integer** | The total sum of fees amount in cents. It calculates the cumulative amount of all the fees associated with the invoice, providing a consolidated value. | | diff --git a/ruby/docs/InvoiceObjectExtended.md b/ruby/docs/InvoiceObjectExtended.md index 9455959..8b706e3 100644 --- a/ruby/docs/InvoiceObjectExtended.md +++ b/ruby/docs/InvoiceObjectExtended.md @@ -11,7 +11,7 @@ | **payment_due_date** | **Date** | The payment due date for the invoice, specified in the ISO 8601 date format. | [optional] | | **net_payment_term** | **Integer** | The net payment term, expressed in days, specifies the duration within which a customer is expected to remit payment after the invoice is finalized. | [optional] | | **invoice_type** | **String** | The type of invoice issued. Possible values are `subscription`, `one-off` or `credit`. | | -| **status** | **String** | The status of the invoice. It indicates the current state of the invoice and can have two possible values: - `draft`: the invoice is in the draft state, waiting for the end of the grace period to be finalized. During this period, events can still be ingested and added to the invoice. - `finalized`: the invoice has been issued and finalized. In this state, events cannot be ingested or added to the invoice anymore. | | +| **status** | **String** | The status of the invoice. It indicates the current state of the invoice and can have two possible values: - `draft`: the invoice is in the draft state, waiting for the end of the grace period to be finalized. During this period, events can still be ingested and added to the invoice. - `finalized`: the invoice has been issued and finalized. In this state, events cannot be ingested or added to the invoice anymore. - `voided`: the invoice has been issued and subsequently voided. In this state, events cannot be ingested or added to the invoice anymore. | | | **payment_status** | **String** | The status of the payment associated with the invoice. It can have one of the following values: - `pending`: the payment is pending, waiting for payment processing in Stripe or when the invoice is emitted but users have not updated the payment status through the endpoint. - `succeeded`: the payment of the invoice has been successfully processed. - `failed`: the payment of the invoice has failed or encountered an error during processing. | | | **currency** | [**Currency**](Currency.md) | | | | **fees_amount_cents** | **Integer** | The total sum of fees amount in cents. It calculates the cumulative amount of all the fees associated with the invoice, providing a consolidated value. | | diff --git a/ruby/docs/InvoicesApi.md b/ruby/docs/InvoicesApi.md index 2c32931..477b44f 100644 --- a/ruby/docs/InvoicesApi.md +++ b/ruby/docs/InvoicesApi.md @@ -12,6 +12,7 @@ All URIs are relative to *https://api.getlago.com/api/v1* | [**refresh_invoice**](InvoicesApi.md#refresh_invoice) | **PUT** /invoices/{lago_id}/refresh | Refresh a draft invoice | | [**retry_payment**](InvoicesApi.md#retry_payment) | **POST** /invoices/{lago_id}/retry_payment | Retry an invoice payment | | [**update_invoice**](InvoicesApi.md#update_invoice) | **PUT** /invoices/{lago_id} | Update an invoice | +| [**void_invoice**](InvoicesApi.md#void_invoice) | **POST** /invoices/{lago_id}/void | Void an invoice | ## create_invoice @@ -580,3 +581,72 @@ end - **Content-Type**: application/json - **Accept**: application/json + +## void_invoice + +> void_invoice(lago_id) + +Void an invoice + +This endpoint is used for voiding an invoice. You can void an invoice only when it's in a `finalized` status, and the payment status is not `succeeded`. + +### Examples + +```ruby +require 'time' +require 'lago_ruby' +# setup authorization +LagoAPI.configure do |config| + # Configure Bearer authorization: bearerAuth + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = LagoAPI::InvoicesApi.new +lago_id = '1a901a90-1a90-1a90-1a90-1a901a901a90' # String | Unique identifier assigned to the invoice within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the invoice’s record within the Lago system. + +begin + # Void an invoice + result = api_instance.void_invoice(lago_id) + p result +rescue LagoAPI::ApiError => e + puts "Error when calling InvoicesApi->void_invoice: #{e}" +end +``` + +#### Using the void_invoice_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> void_invoice_with_http_info(lago_id) + +```ruby +begin + # Void an invoice + data, status_code, headers = api_instance.void_invoice_with_http_info(lago_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue LagoAPI::ApiError => e + puts "Error when calling InvoicesApi->void_invoice_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **lago_id** | **String** | Unique identifier assigned to the invoice within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the invoice’s record within the Lago system. | | + +### Return type + +[**Invoice**](Invoice.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + diff --git a/ruby/docs/OrganizationObject.md b/ruby/docs/OrganizationObject.md index f013c88..e3e229e 100644 --- a/ruby/docs/OrganizationObject.md +++ b/ruby/docs/OrganizationObject.md @@ -19,6 +19,8 @@ | **city** | **String** | The city of your organization’s billing address. | [optional] | | **legal_name** | **String** | The legal name of your organization. | [optional] | | **legal_number** | **String** | The legal number of your organization. | [optional] | +| **document_numbering** | **String** | This parameter configures the method of incrementing invoice numbers for your customers. - `per_customer`: Invoice numbers are incremented individually for each customer. This means every customer will have their own unique sequence of invoice numbers, separate from other customers. It ensures that each customer's invoice numbers follow a distinct and isolated numbering pattern. - `per_organization`: Invoice number incrementation is made across your entire organization. Rather than individual sequences for each customer, all invoices within the organization follow a single, unified numbering system. This creates a continuous and organization-wide sequence for all invoice numbers. Invoices are incremented per month (dynamic value used is YYYYMM), and invoice numbers are reset at the end of each month. The default value for `document_numbering` is set to `per_customer`, meaning that, unless changed, invoice numbers will increment uniquely for each customer. | | +| **document_number_prefix** | **String** | Sets the prefix for invoices and credit notes. Default is the first three letters of your organization name plus the last four digits of your organization ID. Customizable within 1-10 characters, and automatically capitalized by Lago. | | | **net_payment_term** | **Integer** | The net payment term, expressed in days, specifies the duration within which a customer is expected to remit payment after the invoice is finalized. | [optional] | | **tax_identification_number** | **String** | The tax identification number of your organization. | [optional] | | **timezone** | [**Timezone**](Timezone.md) | | [optional] | @@ -46,6 +48,8 @@ instance = LagoAPI::OrganizationObject.new( city: New York, legal_name: null, legal_number: null, + document_numbering: per_customer, + document_number_prefix: ORG-1234, net_payment_term: 30, tax_identification_number: US123456789, timezone: null, diff --git a/ruby/docs/OrganizationUpdateInputOrganization.md b/ruby/docs/OrganizationUpdateInputOrganization.md index 23ab4dc..67c71e4 100644 --- a/ruby/docs/OrganizationUpdateInputOrganization.md +++ b/ruby/docs/OrganizationUpdateInputOrganization.md @@ -15,6 +15,8 @@ | **city** | **String** | The city of your organization’s billing address. | [optional] | | **legal_name** | **String** | The legal name of your organization. | [optional] | | **legal_number** | **String** | The legal number of your organization. | [optional] | +| **document_numbering** | **String** | This parameter configures the method of incrementing invoice numbers for your customers. - `per_customer`: Invoice numbers are incremented individually for each customer. This means every customer will have their own unique sequence of invoice numbers, separate from other customers. It ensures that each customer's invoice numbers follow a distinct and isolated numbering pattern. - `per_organization`: Invoice number incrementation is made across your entire organization. Rather than individual sequences for each customer, all invoices within the organization follow a single, unified numbering system. This creates a continuous and organization-wide sequence for all invoice numbers. Invoices are incremented per month (dynamic value used is YYYYMM), and invoice numbers are reset at the end of each month. The default value for `document_numbering` is set to `per_customer`, meaning that, unless changed, invoice numbers will increment uniquely for each customer. | [optional] | +| **document_number_prefix** | **String** | Sets the prefix for invoices and credit notes. Default is the first three letters of your organization name plus the last four digits of your organization ID. Customizable within 1-10 characters, and automatically capitalized by Lago. | [optional] | | **net_payment_term** | **Integer** | The net payment term, expressed in days, specifies the duration within which a customer is expected to remit payment after the invoice is finalized. | [optional] | | **tax_identification_number** | **String** | The tax identification number of your organization. | [optional] | | **timezone** | [**Timezone**](Timezone.md) | | [optional] | @@ -38,6 +40,8 @@ instance = LagoAPI::OrganizationUpdateInputOrganization.new( city: New York, legal_name: null, legal_number: null, + document_numbering: per_customer, + document_number_prefix: ORG-1234, net_payment_term: 30, tax_identification_number: US123456789, timezone: null, diff --git a/ruby/docs/SubscriptionObject.md b/ruby/docs/SubscriptionObject.md index 9dacb88..9b19830 100644 --- a/ruby/docs/SubscriptionObject.md +++ b/ruby/docs/SubscriptionObject.md @@ -20,7 +20,7 @@ | **terminated_at** | **Time** | The termination date of the subscription. This field is not null when the subscription is `terminated`. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC) | [optional] | | **previous_plan_code** | **String** | The code identifying the previous plan associated with this subscription. | [optional] | | **next_plan_code** | **String** | The code identifying the next plan in the case of a downgrade. | [optional] | -| **downgrade_plan_date** | **Time** | The date when the plan will be downgraded, represented in ISO 8601 date format. | [optional] | +| **downgrade_plan_date** | **Date** | The date when the plan will be downgraded, represented in ISO 8601 date format. | [optional] | ## Example @@ -44,7 +44,7 @@ instance = LagoAPI::SubscriptionObject.new( terminated_at: 2022-09-14T16:35:31Z, previous_plan_code: null, next_plan_code: null, - downgrade_plan_date: null + downgrade_plan_date: Sat Apr 30 00:00:00 UTC 2022 ) ``` diff --git a/ruby/docs/SubscriptionObjectExtended.md b/ruby/docs/SubscriptionObjectExtended.md index adf63bd..afd0037 100644 --- a/ruby/docs/SubscriptionObjectExtended.md +++ b/ruby/docs/SubscriptionObjectExtended.md @@ -20,7 +20,7 @@ | **terminated_at** | **Time** | The termination date of the subscription. This field is not null when the subscription is `terminated`. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC) | [optional] | | **previous_plan_code** | **String** | The code identifying the previous plan associated with this subscription. | [optional] | | **next_plan_code** | **String** | The code identifying the next plan in the case of a downgrade. | [optional] | -| **downgrade_plan_date** | **Time** | The date when the plan will be downgraded, represented in ISO 8601 date format. | [optional] | +| **downgrade_plan_date** | **Date** | The date when the plan will be downgraded, represented in ISO 8601 date format. | [optional] | | **plan** | [**PlanObject**](PlanObject.md) | | [optional] | ## Example @@ -45,7 +45,7 @@ instance = LagoAPI::SubscriptionObjectExtended.new( terminated_at: 2022-09-14T16:35:31Z, previous_plan_code: null, next_plan_code: null, - downgrade_plan_date: null, + downgrade_plan_date: Sat Apr 30 00:00:00 UTC 2022, plan: null ) ``` diff --git a/ruby/docs/SubscriptionUpdateInput.md b/ruby/docs/SubscriptionUpdateInput.md index 52c06c1..0e537af 100644 --- a/ruby/docs/SubscriptionUpdateInput.md +++ b/ruby/docs/SubscriptionUpdateInput.md @@ -4,6 +4,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | +| **status** | **String** | If the field is not defined and multiple `active` and `pending` subscriptions exists, Lago will update the `active` subscription. However, if you wish to update a `pending` subscription, please ensure that you include the `status` attribute with the `pending` value in your request body. | [optional] | | **subscription** | [**SubscriptionUpdateInputSubscription**](SubscriptionUpdateInputSubscription.md) | | | ## Example @@ -12,6 +13,7 @@ require 'lago_ruby' instance = LagoAPI::SubscriptionUpdateInput.new( + status: active, subscription: null ) ``` diff --git a/ruby/docs/WalletCreateInputWallet.md b/ruby/docs/WalletCreateInputWallet.md index dcca731..6f9c6a6 100644 --- a/ruby/docs/WalletCreateInputWallet.md +++ b/ruby/docs/WalletCreateInputWallet.md @@ -11,6 +11,7 @@ | **granted_credits** | **String** | The number of free granted credits. Required only if there is no paid credits. | [optional] | | **external_customer_id** | **String** | The customer external unique identifier (provided by your own application) | | | **expiration_at** | **Time** | The date and time that determines when the wallet will expire. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC). | [optional] | +| **recurring_transaction_rules** | [**Array<WalletCreateInputWalletRecurringTransactionRulesInner>**](WalletCreateInputWalletRecurringTransactionRulesInner.md) | List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. | [optional] | ## Example @@ -24,7 +25,8 @@ instance = LagoAPI::WalletCreateInputWallet.new( paid_credits: 20.0, granted_credits: 10.0, external_customer_id: hooli_1234, - expiration_at: 2022-07-07T23:59:59Z + expiration_at: 2022-07-07T23:59:59Z, + recurring_transaction_rules: null ) ``` diff --git a/ruby/docs/WalletCreateInputWalletRecurringTransactionRulesInner.md b/ruby/docs/WalletCreateInputWalletRecurringTransactionRulesInner.md new file mode 100644 index 0000000..b53ee24 --- /dev/null +++ b/ruby/docs/WalletCreateInputWalletRecurringTransactionRulesInner.md @@ -0,0 +1,22 @@ +# LagoAPI::WalletCreateInputWalletRecurringTransactionRulesInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **rule_type** | **String** | The rule type. Possible values are `interval` or `threshold`. | | +| **interval** | **String** | The interval used for recurring top-up. It represents the frequency at which automatic top-up occurs. The interval can be one of the following values: `weekly`, `monthly`, `quarterly` or `yearly`. Required only when rule type is `interval`. | [optional] | +| **threshold_credits** | **String** | The threshold for recurring top-ups is the value at which an automatic top-up is triggered. For example, if this threshold is set at 10 credits, an automatic top-up will occur whenever the wallet balance falls to or below 10 credits. Required only when rule type is set to `threshold`. | [optional] | + +## Example + +```ruby +require 'lago_ruby' + +instance = LagoAPI::WalletCreateInputWalletRecurringTransactionRulesInner.new( + rule_type: interval, + interval: monthly, + threshold_credits: 20.0 +) +``` + diff --git a/ruby/docs/WalletObject.md b/ruby/docs/WalletObject.md index 406f115..e84e7a3 100644 --- a/ruby/docs/WalletObject.md +++ b/ruby/docs/WalletObject.md @@ -19,6 +19,11 @@ | **last_balance_sync_at** | **Time** | The date and time of the last balance top-up. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC). | [optional] | | **last_consumed_credit_at** | **Time** | The date and time of the last credits consumption. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC). | [optional] | | **terminated_at** | **Time** | The date of terminaison of the wallet. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC). | [optional] | +| **recurring_transaction_rules** | [**Array<WalletObjectRecurringTransactionRulesInner>**](WalletObjectRecurringTransactionRulesInner.md) | List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. | [optional] | +| **ongoing_balance_cents** | **Integer** | The wallet ongoing balance expressed in cents. | | +| **ongoing_usage_balance_cents** | **Integer** | The wallet ongoing usage balance expressed in cents. | | +| **credits_ongoing_balance** | **String** | The wallet ongoing balance expressed in credits. | | +| **credits_ongoing_usage_balance** | **String** | The wallet ongoing usage balance expressed in credits. | | ## Example @@ -40,7 +45,12 @@ instance = LagoAPI::WalletObject.new( expiration_at: null, last_balance_sync_at: 2022-04-29T08:59:51Z, last_consumed_credit_at: 2022-04-29T08:59:51Z, - terminated_at: 2022-09-14T16:35:31Z + terminated_at: 2022-09-14T16:35:31Z, + recurring_transaction_rules: null, + ongoing_balance_cents: 800, + ongoing_usage_balance_cents: 200, + credits_ongoing_balance: 8.0, + credits_ongoing_usage_balance: 2.0 ) ``` diff --git a/ruby/docs/WalletObjectRecurringTransactionRulesInner.md b/ruby/docs/WalletObjectRecurringTransactionRulesInner.md new file mode 100644 index 0000000..fe7b637 --- /dev/null +++ b/ruby/docs/WalletObjectRecurringTransactionRulesInner.md @@ -0,0 +1,30 @@ +# LagoAPI::WalletObjectRecurringTransactionRulesInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **lago_id** | **String** | A unique identifier for the recurring transaction rule in the Lago application. Can be used to update a recurring transaction rule. | | +| **rule_type** | **String** | The rule type. Possible values are `interval` or `threshold`. | | +| **interval** | **String** | The interval used for recurring top-up. It represents the frequency at which automatic top-up occurs. The interval can be one of the following values: `weekly`, `monthly`, `quarterly` or `yearly`. Required only if rule type is set to `interval`. | [optional] | +| **threshold_credits** | **String** | The threshold for recurring top-ups is the value at which an automatic top-up is triggered. For example, if this threshold is set at 10 credits, an automatic top-up will occur whenever the wallet balance falls to or below 10 credits. Required only when rule type is set to `threshold`. | [optional] | +| **paid_credits** | **String** | The number of paid credits. Required only if there is no granted credits. | | +| **granted_credits** | **String** | The number of free granted credits. Required only if there is no paid credits. | | +| **created_at** | **Time** | The date of the metadata object creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). The creation_date provides a standardized and internationally recognized timestamp for when the metadata object was created | | + +## Example + +```ruby +require 'lago_ruby' + +instance = LagoAPI::WalletObjectRecurringTransactionRulesInner.new( + lago_id: 1a901a90-1a90-1a90-1a90-1a901a901a90, + rule_type: interval, + interval: monthly, + threshold_credits: 20.0, + paid_credits: 20.0, + granted_credits: 10.0, + created_at: 2022-04-29T08:59:51Z +) +``` + diff --git a/ruby/docs/WalletUpdateInputWallet.md b/ruby/docs/WalletUpdateInputWallet.md index 1981711..3c72e64 100644 --- a/ruby/docs/WalletUpdateInputWallet.md +++ b/ruby/docs/WalletUpdateInputWallet.md @@ -6,6 +6,7 @@ | ---- | ---- | ----------- | ----- | | **name** | **String** | The name of the wallet. | [optional] | | **expiration_at** | **Time** | The date and time that determines when the wallet will expire. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC). | [optional] | +| **recurring_transaction_rules** | [**Array<WalletUpdateInputWalletRecurringTransactionRulesInner>**](WalletUpdateInputWalletRecurringTransactionRulesInner.md) | List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. | [optional] | ## Example @@ -14,7 +15,8 @@ require 'lago_ruby' instance = LagoAPI::WalletUpdateInputWallet.new( name: new_name, - expiration_at: 2022-07-07T23:59:59Z + expiration_at: 2022-07-07T23:59:59Z, + recurring_transaction_rules: null ) ``` diff --git a/ruby/docs/WalletUpdateInputWalletRecurringTransactionRulesInner.md b/ruby/docs/WalletUpdateInputWalletRecurringTransactionRulesInner.md new file mode 100644 index 0000000..3440687 --- /dev/null +++ b/ruby/docs/WalletUpdateInputWalletRecurringTransactionRulesInner.md @@ -0,0 +1,28 @@ +# LagoAPI::WalletUpdateInputWalletRecurringTransactionRulesInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **lago_id** | **String** | A unique identifier for the recurring transaction rule in the Lago application. Can be used to update a recurring transaction rule. | [optional] | +| **rule_type** | **String** | The rule type. Possible values are `interval` or `threshold`. | [optional] | +| **interval** | **String** | The interval used for recurring top-up. It represents the frequency at which automatic top-up occurs. The interval can be one of the following values: `weekly`, `monthly`, `quarterly` or `yearly`. Required only when rule type is set to `interval`. | [optional] | +| **threshold_credits** | **String** | The threshold for recurring top-ups is the value at which an automatic top-up is triggered. For example, if this threshold is set at 10 credits, an automatic top-up will occur whenever the wallet balance falls to or below 10 credits. Required only when rule type is set to `threshold`. | [optional] | +| **paid_credits** | **String** | The number of paid credits. Required only if there is no granted credits. | [optional] | +| **granted_credits** | **String** | The number of free granted credits. Required only if there is no paid credits. | [optional] | + +## Example + +```ruby +require 'lago_ruby' + +instance = LagoAPI::WalletUpdateInputWalletRecurringTransactionRulesInner.new( + lago_id: 1a901a90-1a90-1a90-1a90-1a901a901a90, + rule_type: interval, + interval: monthly, + threshold_credits: 20.0, + paid_credits: 20.0, + granted_credits: 10.0 +) +``` + diff --git a/ruby/generator/config.yaml b/ruby/generator/config.yaml index 0c31a93..0540d41 100644 --- a/ruby/generator/config.yaml +++ b/ruby/generator/config.yaml @@ -12,7 +12,7 @@ additionalProperties: gemLicense: MIT gemName: lago_ruby gemSummary: Ruby wrapper for the Lago API - gemVersion: API_VERSION + gemVersion: 0.56.0-beta appName: Lago API docHomepage: https://doc.getlago.com diff --git a/ruby/lago_ruby.gemspec b/ruby/lago_ruby.gemspec index 41931ee..a43e80a 100644 --- a/ruby/lago_ruby.gemspec +++ b/ruby/lago_ruby.gemspec @@ -5,10 +5,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -21,7 +21,7 @@ Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.authors = ["Lago"] s.email = ["tech@getlago.com"] - s.homepage = "https://github.com/getlago/lago-ruby" + s.homepage = "https://github.com/getlago/lago-sdk" s.summary = "Ruby wrapper for the Lago API" s.description = "Enable your ruby application to interact with the Lago API" s.license = "MIT" diff --git a/ruby/lib/lago_ruby.rb b/ruby/lib/lago_ruby.rb index 0017d73..41f8f22 100644 --- a/ruby/lib/lago_ruby.rb +++ b/ruby/lib/lago_ruby.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -85,10 +85,11 @@ require 'lago_ruby/models/currency' require 'lago_ruby/models/customer' require 'lago_ruby/models/customer_billing_configuration' +require 'lago_ruby/models/customer_charge_grouped_usage_object_inner' +require 'lago_ruby/models/customer_charge_groups_usage_object_inner' require 'lago_ruby/models/customer_charge_usage_object' require 'lago_ruby/models/customer_charge_usage_object_billable_metric' require 'lago_ruby/models/customer_charge_usage_object_charge' -require 'lago_ruby/models/customer_charge_usage_object_groups_inner' require 'lago_ruby/models/customer_create_input' require 'lago_ruby/models/customer_create_input_customer' require 'lago_ruby/models/customer_create_input_customer_metadata_inner' @@ -101,8 +102,6 @@ require 'lago_ruby/models/customers_paginated' require 'lago_ruby/models/event' require 'lago_ruby/models/event_batch_input' -require 'lago_ruby/models/event_batch_input_event' -require 'lago_ruby/models/event_batch_input_event_properties' require 'lago_ruby/models/event_estimate_fees_input' require 'lago_ruby/models/event_estimate_fees_input_event' require 'lago_ruby/models/event_input' @@ -113,12 +112,17 @@ require 'lago_ruby/models/fee' require 'lago_ruby/models/fee_applied_tax_object' require 'lago_ruby/models/fee_object' +require 'lago_ruby/models/fee_object_amount_details' +require 'lago_ruby/models/fee_object_amount_details_all_of_graduated_percentage_ranges_inner' +require 'lago_ruby/models/fee_object_amount_details_all_of_graduated_ranges_inner' +require 'lago_ruby/models/fee_object_amount_details_all_of_volume_ranges_inner' require 'lago_ruby/models/fee_object_item' require 'lago_ruby/models/fee_update_input' require 'lago_ruby/models/fee_update_input_fee' require 'lago_ruby/models/fees' require 'lago_ruby/models/fees_paginated' require 'lago_ruby/models/generate_customer_checkout_url200_response' +require 'lago_ruby/models/generate_customer_checkout_url200_response_customer' require 'lago_ruby/models/get_customer_portal_url200_response' require 'lago_ruby/models/get_customer_portal_url200_response_customer' require 'lago_ruby/models/gross_revenue_object' @@ -129,6 +133,8 @@ require 'lago_ruby/models/groups_paginated' require 'lago_ruby/models/invoice' require 'lago_ruby/models/invoice_applied_tax_object' +require 'lago_ruby/models/invoice_collection_object' +require 'lago_ruby/models/invoice_collections' require 'lago_ruby/models/invoice_metadata_object' require 'lago_ruby/models/invoice_object' require 'lago_ruby/models/invoice_object_customer' @@ -149,8 +155,6 @@ require 'lago_ruby/models/organization_object' require 'lago_ruby/models/organization_update_input' require 'lago_ruby/models/organization_update_input_organization' -require 'lago_ruby/models/outstanding_invoice_object' -require 'lago_ruby/models/outstanding_invoices' require 'lago_ruby/models/pagination_meta' require 'lago_ruby/models/plan' require 'lago_ruby/models/plan_create_input' @@ -183,7 +187,9 @@ require 'lago_ruby/models/wallet' require 'lago_ruby/models/wallet_create_input' require 'lago_ruby/models/wallet_create_input_wallet' +require 'lago_ruby/models/wallet_create_input_wallet_recurring_transaction_rules_inner' require 'lago_ruby/models/wallet_object' +require 'lago_ruby/models/wallet_object_recurring_transaction_rules_inner' require 'lago_ruby/models/wallet_transaction_create_input' require 'lago_ruby/models/wallet_transaction_create_input_wallet_transaction' require 'lago_ruby/models/wallet_transaction_object' @@ -191,6 +197,7 @@ require 'lago_ruby/models/wallet_transactions_paginated' require 'lago_ruby/models/wallet_update_input' require 'lago_ruby/models/wallet_update_input_wallet' +require 'lago_ruby/models/wallet_update_input_wallet_recurring_transaction_rules_inner' require 'lago_ruby/models/wallets_paginated' require 'lago_ruby/models/webhook_endpoint' require 'lago_ruby/models/webhook_endpoint_create_input' diff --git a/ruby/lib/lago_ruby/api/add_ons_api.rb b/ruby/lib/lago_ruby/api/add_ons_api.rb index adc27ea..734ef4f 100644 --- a/ruby/lib/lago_ruby/api/add_ons_api.rb +++ b/ruby/lib/lago_ruby/api/add_ons_api.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/api/analytics_api.rb b/ruby/lib/lago_ruby/api/analytics_api.rb index c22d5eb..be27725 100644 --- a/ruby/lib/lago_ruby/api/analytics_api.rb +++ b/ruby/lib/lago_ruby/api/analytics_api.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -82,27 +82,27 @@ def find_all_gross_revenues_with_http_info(opts = {}) return data, status_code, headers end - # List usage revenue - # Reports a monthly analysis focused on the revenue generated from all usage-based fees. It exclusively accounts for revenue that has been formally invoiced. Importantly, this report does not include revenue related to the usage in the current billing period, limiting its scope to previously invoiced amounts. + # List of finalized invoices + # Represents a monthly aggregation, detailing both the total count and the cumulative amount of invoices that have been marked as `finalized`. This report sorts invoices categorically based on their `payment_status`. # @param [Hash] opts the optional parameters - # @option opts [Currency] :currency The currency of invoiced usage analytics. Format must be ISO 4217. - # @return [InvoicedUsages] - def find_all_invoiced_usages(opts = {}) - data, _status_code, _headers = find_all_invoiced_usages_with_http_info(opts) + # @option opts [Currency] :currency The currency of revenue analytics. Format must be ISO 4217. + # @return [InvoiceCollections] + def find_all_invoice_collections(opts = {}) + data, _status_code, _headers = find_all_invoice_collections_with_http_info(opts) data end - # List usage revenue - # Reports a monthly analysis focused on the revenue generated from all usage-based fees. It exclusively accounts for revenue that has been formally invoiced. Importantly, this report does not include revenue related to the usage in the current billing period, limiting its scope to previously invoiced amounts. + # List of finalized invoices + # Represents a monthly aggregation, detailing both the total count and the cumulative amount of invoices that have been marked as `finalized`. This report sorts invoices categorically based on their `payment_status`. # @param [Hash] opts the optional parameters - # @option opts [Currency] :currency The currency of invoiced usage analytics. Format must be ISO 4217. - # @return [Array<(InvoicedUsages, Integer, Hash)>] InvoicedUsages data, response status code and response headers - def find_all_invoiced_usages_with_http_info(opts = {}) + # @option opts [Currency] :currency The currency of revenue analytics. Format must be ISO 4217. + # @return [Array<(InvoiceCollections, Integer, Hash)>] InvoiceCollections data, response status code and response headers + def find_all_invoice_collections_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AnalyticsApi.find_all_invoiced_usages ...' + @api_client.config.logger.debug 'Calling API: AnalyticsApi.find_all_invoice_collections ...' end # resource path - local_var_path = '/analytics/invoiced_usage' + local_var_path = '/analytics/invoice_collection' # query parameters query_params = opts[:query_params] || {} @@ -120,13 +120,13 @@ def find_all_invoiced_usages_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'InvoicedUsages' + return_type = opts[:debug_return_type] || 'InvoiceCollections' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] new_options = opts.merge( - :operation => :"AnalyticsApi.find_all_invoiced_usages", + :operation => :"AnalyticsApi.find_all_invoice_collections", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -137,39 +137,36 @@ def find_all_invoiced_usages_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: AnalyticsApi#find_all_invoiced_usages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: AnalyticsApi#find_all_invoice_collections\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # List MRR - # This endpoint is used to list MRR. + # List usage revenue + # Reports a monthly analysis focused on the revenue generated from all usage-based fees. It exclusively accounts for revenue that has been formally invoiced. Importantly, this report does not include revenue related to the usage in the current billing period, limiting its scope to previously invoiced amounts. # @param [Hash] opts the optional parameters - # @option opts [Currency] :currency Quantifies the revenue generated from `subscription` fees on a monthly basis. This figure is calculated post-application of applicable taxes and prior to the deduction of any applicable discounts. The method of calculation varies based on the subscription billing cycle: - Revenue from `monthly` subscription invoices is included in the MRR for the month in which the invoice is issued. - Revenue from `quarterly` subscription invoices is distributed evenly over three months. This distribution applies to fees paid in advance (allocated to the next three months) as well as to fees paid in arrears (allocated to the preceding three months). - Revenue from `yearly` subscription invoices is distributed evenly over twelve months. This allocation is applicable for fees paid in advance (spread over the next twelve months) and for fees paid in arrears (spread over the previous twelve months). - Revenue from `weekly` subscription invoices, the total revenue from all invoices issued within a month is summed up. This total is then divided by the number of invoices issued during that month, and the result is multiplied by 4.33, representing the average number of weeks in a month. - # @option opts [Integer] :months Show data only for given number of months. - # @return [Mrrs] - def find_all_mrrs(opts = {}) - data, _status_code, _headers = find_all_mrrs_with_http_info(opts) + # @option opts [Currency] :currency The currency of invoiced usage analytics. Format must be ISO 4217. + # @return [InvoicedUsages] + def find_all_invoiced_usages(opts = {}) + data, _status_code, _headers = find_all_invoiced_usages_with_http_info(opts) data end - # List MRR - # This endpoint is used to list MRR. + # List usage revenue + # Reports a monthly analysis focused on the revenue generated from all usage-based fees. It exclusively accounts for revenue that has been formally invoiced. Importantly, this report does not include revenue related to the usage in the current billing period, limiting its scope to previously invoiced amounts. # @param [Hash] opts the optional parameters - # @option opts [Currency] :currency Quantifies the revenue generated from `subscription` fees on a monthly basis. This figure is calculated post-application of applicable taxes and prior to the deduction of any applicable discounts. The method of calculation varies based on the subscription billing cycle: - Revenue from `monthly` subscription invoices is included in the MRR for the month in which the invoice is issued. - Revenue from `quarterly` subscription invoices is distributed evenly over three months. This distribution applies to fees paid in advance (allocated to the next three months) as well as to fees paid in arrears (allocated to the preceding three months). - Revenue from `yearly` subscription invoices is distributed evenly over twelve months. This allocation is applicable for fees paid in advance (spread over the next twelve months) and for fees paid in arrears (spread over the previous twelve months). - Revenue from `weekly` subscription invoices, the total revenue from all invoices issued within a month is summed up. This total is then divided by the number of invoices issued during that month, and the result is multiplied by 4.33, representing the average number of weeks in a month. - # @option opts [Integer] :months Show data only for given number of months. - # @return [Array<(Mrrs, Integer, Hash)>] Mrrs data, response status code and response headers - def find_all_mrrs_with_http_info(opts = {}) + # @option opts [Currency] :currency The currency of invoiced usage analytics. Format must be ISO 4217. + # @return [Array<(InvoicedUsages, Integer, Hash)>] InvoicedUsages data, response status code and response headers + def find_all_invoiced_usages_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AnalyticsApi.find_all_mrrs ...' + @api_client.config.logger.debug 'Calling API: AnalyticsApi.find_all_invoiced_usages ...' end # resource path - local_var_path = '/analytics/mrr' + local_var_path = '/analytics/invoiced_usage' # query parameters query_params = opts[:query_params] || {} query_params[:'currency'] = opts[:'currency'] if !opts[:'currency'].nil? - query_params[:'months'] = opts[:'months'] if !opts[:'months'].nil? # header parameters header_params = opts[:header_params] || {} @@ -183,13 +180,13 @@ def find_all_mrrs_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'Mrrs' + return_type = opts[:debug_return_type] || 'InvoicedUsages' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] new_options = opts.merge( - :operation => :"AnalyticsApi.find_all_mrrs", + :operation => :"AnalyticsApi.find_all_invoiced_usages", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -200,36 +197,39 @@ def find_all_mrrs_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: AnalyticsApi#find_all_mrrs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: AnalyticsApi#find_all_invoiced_usages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # List outstanding invoices - # Represents a monthly aggregation, detailing both the total count and the cumulative amount of invoices that have been marked as `finalized`. This report sorts invoices categorically based on their `payment_status`. + # List MRR + # This endpoint is used to list MRR. # @param [Hash] opts the optional parameters - # @option opts [Currency] :currency The currency of revenue analytics. Format must be ISO 4217. - # @return [OutstandingInvoices] - def find_all_outstanding_invoices(opts = {}) - data, _status_code, _headers = find_all_outstanding_invoices_with_http_info(opts) + # @option opts [Currency] :currency Quantifies the revenue generated from `subscription` fees on a monthly basis. This figure is calculated post-application of applicable taxes and deduction of any applicable discounts. The method of calculation varies based on the subscription billing cycle: - Revenue from `monthly` subscription invoices is included in the MRR for the month in which the invoice is issued. - Revenue from `quarterly` subscription invoices is distributed evenly over three months. This distribution applies to fees paid in advance (allocated to the next remaining months depending on calendar or anniversary billing) as well as to fees paid in arrears (allocated to the preceding months depending on calendar or anniversary billing). - Revenue from `yearly` subscription invoices is distributed evenly over twelve months. This allocation is applicable for fees paid in advance (spread over the next remaining months depending on calendar or anniversary billing) and for fees paid in arrears (spread over the previous months depending on calendar or anniversary billing). - Revenue from `weekly` subscription invoices, the total revenue from all invoices issued within a month is summed up. This total is then divided by the number of invoices issued during that month, and the result is multiplied by 4.33, representing the average number of weeks in a month. + # @option opts [Integer] :months Show data only for given number of months. + # @return [Mrrs] + def find_all_mrrs(opts = {}) + data, _status_code, _headers = find_all_mrrs_with_http_info(opts) data end - # List outstanding invoices - # Represents a monthly aggregation, detailing both the total count and the cumulative amount of invoices that have been marked as `finalized`. This report sorts invoices categorically based on their `payment_status`. + # List MRR + # This endpoint is used to list MRR. # @param [Hash] opts the optional parameters - # @option opts [Currency] :currency The currency of revenue analytics. Format must be ISO 4217. - # @return [Array<(OutstandingInvoices, Integer, Hash)>] OutstandingInvoices data, response status code and response headers - def find_all_outstanding_invoices_with_http_info(opts = {}) + # @option opts [Currency] :currency Quantifies the revenue generated from `subscription` fees on a monthly basis. This figure is calculated post-application of applicable taxes and deduction of any applicable discounts. The method of calculation varies based on the subscription billing cycle: - Revenue from `monthly` subscription invoices is included in the MRR for the month in which the invoice is issued. - Revenue from `quarterly` subscription invoices is distributed evenly over three months. This distribution applies to fees paid in advance (allocated to the next remaining months depending on calendar or anniversary billing) as well as to fees paid in arrears (allocated to the preceding months depending on calendar or anniversary billing). - Revenue from `yearly` subscription invoices is distributed evenly over twelve months. This allocation is applicable for fees paid in advance (spread over the next remaining months depending on calendar or anniversary billing) and for fees paid in arrears (spread over the previous months depending on calendar or anniversary billing). - Revenue from `weekly` subscription invoices, the total revenue from all invoices issued within a month is summed up. This total is then divided by the number of invoices issued during that month, and the result is multiplied by 4.33, representing the average number of weeks in a month. + # @option opts [Integer] :months Show data only for given number of months. + # @return [Array<(Mrrs, Integer, Hash)>] Mrrs data, response status code and response headers + def find_all_mrrs_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AnalyticsApi.find_all_outstanding_invoices ...' + @api_client.config.logger.debug 'Calling API: AnalyticsApi.find_all_mrrs ...' end # resource path - local_var_path = '/analytics/outstanding_invoices' + local_var_path = '/analytics/mrr' # query parameters query_params = opts[:query_params] || {} query_params[:'currency'] = opts[:'currency'] if !opts[:'currency'].nil? + query_params[:'months'] = opts[:'months'] if !opts[:'months'].nil? # header parameters header_params = opts[:header_params] || {} @@ -243,13 +243,13 @@ def find_all_outstanding_invoices_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'OutstandingInvoices' + return_type = opts[:debug_return_type] || 'Mrrs' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] new_options = opts.merge( - :operation => :"AnalyticsApi.find_all_outstanding_invoices", + :operation => :"AnalyticsApi.find_all_mrrs", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -260,7 +260,7 @@ def find_all_outstanding_invoices_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: AnalyticsApi#find_all_outstanding_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: AnalyticsApi#find_all_mrrs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end diff --git a/ruby/lib/lago_ruby/api/billable_metrics_api.rb b/ruby/lib/lago_ruby/api/billable_metrics_api.rb index 58e03db..9b6b963 100644 --- a/ruby/lib/lago_ruby/api/billable_metrics_api.rb +++ b/ruby/lib/lago_ruby/api/billable_metrics_api.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/api/coupons_api.rb b/ruby/lib/lago_ruby/api/coupons_api.rb index c97af94..8044920 100644 --- a/ruby/lib/lago_ruby/api/coupons_api.rb +++ b/ruby/lib/lago_ruby/api/coupons_api.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/api/credit_notes_api.rb b/ruby/lib/lago_ruby/api/credit_notes_api.rb index 101b1bd..4e12643 100644 --- a/ruby/lib/lago_ruby/api/credit_notes_api.rb +++ b/ruby/lib/lago_ruby/api/credit_notes_api.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/api/customers_api.rb b/ruby/lib/lago_ruby/api/customers_api.rb index 5028234..6623d66 100644 --- a/ruby/lib/lago_ruby/api/customers_api.rb +++ b/ruby/lib/lago_ruby/api/customers_api.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/api/events_api.rb b/ruby/lib/lago_ruby/api/events_api.rb index 5683927..d465871 100644 --- a/ruby/lib/lago_ruby/api/events_api.rb +++ b/ruby/lib/lago_ruby/api/events_api.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -20,7 +20,7 @@ def initialize(api_client = ApiClient.default) @api_client = api_client end # Batch multiple events - # This endpoint is used for transmitting a batch of usage measurement events to multiple subscriptions for a single customer. + # This endpoint is used to send a batch of usage records. # @param event_batch_input [EventBatchInput] Batch events payload # @param [Hash] opts the optional parameters # @return [nil] @@ -30,7 +30,7 @@ def create_batch_events(event_batch_input, opts = {}) end # Batch multiple events - # This endpoint is used for transmitting a batch of usage measurement events to multiple subscriptions for a single customer. + # This endpoint is used to send a batch of usage records. # @param event_batch_input [EventBatchInput] Batch events payload # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers diff --git a/ruby/lib/lago_ruby/api/fees_api.rb b/ruby/lib/lago_ruby/api/fees_api.rb index 8a6f6ec..74b75ac 100644 --- a/ruby/lib/lago_ruby/api/fees_api.rb +++ b/ruby/lib/lago_ruby/api/fees_api.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/api/invoices_api.rb b/ruby/lib/lago_ruby/api/invoices_api.rb index a9951e5..149adf2 100644 --- a/ruby/lib/lago_ruby/api/invoices_api.rb +++ b/ruby/lib/lago_ruby/api/invoices_api.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -561,5 +561,68 @@ def update_invoice_with_http_info(lago_id, invoice_update_input, opts = {}) end return data, status_code, headers end + + # Void an invoice + # This endpoint is used for voiding an invoice. You can void an invoice only when it's in a `finalized` status, and the payment status is not `succeeded`. + # @param lago_id [String] Unique identifier assigned to the invoice within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the invoice’s record within the Lago system. + # @param [Hash] opts the optional parameters + # @return [Invoice] + def void_invoice(lago_id, opts = {}) + data, _status_code, _headers = void_invoice_with_http_info(lago_id, opts) + data + end + + # Void an invoice + # This endpoint is used for voiding an invoice. You can void an invoice only when it's in a `finalized` status, and the payment status is not `succeeded`. + # @param lago_id [String] Unique identifier assigned to the invoice within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the invoice’s record within the Lago system. + # @param [Hash] opts the optional parameters + # @return [Array<(Invoice, Integer, Hash)>] Invoice data, response status code and response headers + def void_invoice_with_http_info(lago_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: InvoicesApi.void_invoice ...' + end + # verify the required parameter 'lago_id' is set + if @api_client.config.client_side_validation && lago_id.nil? + fail ArgumentError, "Missing the required parameter 'lago_id' when calling InvoicesApi.void_invoice" + end + # resource path + local_var_path = '/invoices/{lago_id}/void'.sub('{' + 'lago_id' + '}', CGI.escape(lago_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Invoice' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearerAuth'] + + new_options = opts.merge( + :operation => :"InvoicesApi.void_invoice", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: InvoicesApi#void_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/ruby/lib/lago_ruby/api/organizations_api.rb b/ruby/lib/lago_ruby/api/organizations_api.rb index dbfab39..db6c2fc 100644 --- a/ruby/lib/lago_ruby/api/organizations_api.rb +++ b/ruby/lib/lago_ruby/api/organizations_api.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/api/plans_api.rb b/ruby/lib/lago_ruby/api/plans_api.rb index d78d1ac..105cc75 100644 --- a/ruby/lib/lago_ruby/api/plans_api.rb +++ b/ruby/lib/lago_ruby/api/plans_api.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/api/subscriptions_api.rb b/ruby/lib/lago_ruby/api/subscriptions_api.rb index 1a442a8..5adf3e2 100644 --- a/ruby/lib/lago_ruby/api/subscriptions_api.rb +++ b/ruby/lib/lago_ruby/api/subscriptions_api.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/api/taxes_api.rb b/ruby/lib/lago_ruby/api/taxes_api.rb index f1fdd33..c4b0502 100644 --- a/ruby/lib/lago_ruby/api/taxes_api.rb +++ b/ruby/lib/lago_ruby/api/taxes_api.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/api/wallets_api.rb b/ruby/lib/lago_ruby/api/wallets_api.rb index 43e9020..927f5a8 100644 --- a/ruby/lib/lago_ruby/api/wallets_api.rb +++ b/ruby/lib/lago_ruby/api/wallets_api.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/api/webhook_endpoints_api.rb b/ruby/lib/lago_ruby/api/webhook_endpoints_api.rb index 6d849b4..f37287d 100644 --- a/ruby/lib/lago_ruby/api/webhook_endpoints_api.rb +++ b/ruby/lib/lago_ruby/api/webhook_endpoints_api.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/api/webhooks_api.rb b/ruby/lib/lago_ruby/api/webhooks_api.rb index 7c57bba..e200b70 100644 --- a/ruby/lib/lago_ruby/api/webhooks_api.rb +++ b/ruby/lib/lago_ruby/api/webhooks_api.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/api_client.rb b/ruby/lib/lago_ruby/api_client.rb index d0bab36..eb47e5e 100644 --- a/ruby/lib/lago_ruby/api_client.rb +++ b/ruby/lib/lago_ruby/api_client.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -188,14 +188,16 @@ def download_file(request) chunk.force_encoding(encoding) tempfile.write(chunk) end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end + # run the request to ensure the tempfile is created successfully before returning it + request.run + if tempfile + tempfile.close + @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ + "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ + "will be deleted automatically with GC. It's also recommended to delete the temp file "\ + "explicitly with `tempfile.delete`" + else + fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}") end tempfile diff --git a/ruby/lib/lago_ruby/api_error.rb b/ruby/lib/lago_ruby/api_error.rb index eed7342..71cd66b 100644 --- a/ruby/lib/lago_ruby/api_error.rb +++ b/ruby/lib/lago_ruby/api_error.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/configuration.rb b/ruby/lib/lago_ruby/configuration.rb index 7503832..e578481 100644 --- a/ruby/lib/lago_ruby/configuration.rb +++ b/ruby/lib/lago_ruby/configuration.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/add_on.rb b/ruby/lib/lago_ruby/models/add_on.rb index f1ef56b..8fa8d2d 100644 --- a/ruby/lib/lago_ruby/models/add_on.rb +++ b/ruby/lib/lago_ruby/models/add_on.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/add_on_base_input.rb b/ruby/lib/lago_ruby/models/add_on_base_input.rb index c5dd3d3..ef32098 100644 --- a/ruby/lib/lago_ruby/models/add_on_base_input.rb +++ b/ruby/lib/lago_ruby/models/add_on_base_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/add_on_create_input.rb b/ruby/lib/lago_ruby/models/add_on_create_input.rb index 9785831..6e2edef 100644 --- a/ruby/lib/lago_ruby/models/add_on_create_input.rb +++ b/ruby/lib/lago_ruby/models/add_on_create_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/add_on_create_input_add_on.rb b/ruby/lib/lago_ruby/models/add_on_create_input_add_on.rb index 9da96b4..b4024f2 100644 --- a/ruby/lib/lago_ruby/models/add_on_create_input_add_on.rb +++ b/ruby/lib/lago_ruby/models/add_on_create_input_add_on.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/add_on_object.rb b/ruby/lib/lago_ruby/models/add_on_object.rb index 73fabe3..0d57604 100644 --- a/ruby/lib/lago_ruby/models/add_on_object.rb +++ b/ruby/lib/lago_ruby/models/add_on_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/add_on_update_input.rb b/ruby/lib/lago_ruby/models/add_on_update_input.rb index 45f9eb7..1c78221 100644 --- a/ruby/lib/lago_ruby/models/add_on_update_input.rb +++ b/ruby/lib/lago_ruby/models/add_on_update_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/add_ons_paginated.rb b/ruby/lib/lago_ruby/models/add_ons_paginated.rb index 04240ce..4f5dca4 100644 --- a/ruby/lib/lago_ruby/models/add_ons_paginated.rb +++ b/ruby/lib/lago_ruby/models/add_ons_paginated.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/api_error_bad_request.rb b/ruby/lib/lago_ruby/models/api_error_bad_request.rb index 3638edf..529845d 100644 --- a/ruby/lib/lago_ruby/models/api_error_bad_request.rb +++ b/ruby/lib/lago_ruby/models/api_error_bad_request.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/api_error_forbidden.rb b/ruby/lib/lago_ruby/models/api_error_forbidden.rb index f50baa7..dd7661a 100644 --- a/ruby/lib/lago_ruby/models/api_error_forbidden.rb +++ b/ruby/lib/lago_ruby/models/api_error_forbidden.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/api_error_not_allowed.rb b/ruby/lib/lago_ruby/models/api_error_not_allowed.rb index 9c52975..1242135 100644 --- a/ruby/lib/lago_ruby/models/api_error_not_allowed.rb +++ b/ruby/lib/lago_ruby/models/api_error_not_allowed.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/api_error_not_found.rb b/ruby/lib/lago_ruby/models/api_error_not_found.rb index 8c2e21b..b220919 100644 --- a/ruby/lib/lago_ruby/models/api_error_not_found.rb +++ b/ruby/lib/lago_ruby/models/api_error_not_found.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/api_error_unauthorized.rb b/ruby/lib/lago_ruby/models/api_error_unauthorized.rb index d87e647..37c8855 100644 --- a/ruby/lib/lago_ruby/models/api_error_unauthorized.rb +++ b/ruby/lib/lago_ruby/models/api_error_unauthorized.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/api_error_unprocessable_entity.rb b/ruby/lib/lago_ruby/models/api_error_unprocessable_entity.rb index 95c0b4d..111724d 100644 --- a/ruby/lib/lago_ruby/models/api_error_unprocessable_entity.rb +++ b/ruby/lib/lago_ruby/models/api_error_unprocessable_entity.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/applied_coupon.rb b/ruby/lib/lago_ruby/models/applied_coupon.rb index 99cd5a6..2518c8e 100644 --- a/ruby/lib/lago_ruby/models/applied_coupon.rb +++ b/ruby/lib/lago_ruby/models/applied_coupon.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/applied_coupon_input.rb b/ruby/lib/lago_ruby/models/applied_coupon_input.rb index 6b470c1..d604f67 100644 --- a/ruby/lib/lago_ruby/models/applied_coupon_input.rb +++ b/ruby/lib/lago_ruby/models/applied_coupon_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/applied_coupon_input_applied_coupon.rb b/ruby/lib/lago_ruby/models/applied_coupon_input_applied_coupon.rb index c0220df..79fc5dd 100644 --- a/ruby/lib/lago_ruby/models/applied_coupon_input_applied_coupon.rb +++ b/ruby/lib/lago_ruby/models/applied_coupon_input_applied_coupon.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -173,7 +173,7 @@ def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @external_customer_id.nil? return false if @coupon_code.nil? - frequency_validator = EnumAttributeValidator.new('String', ["once", "recurring"]) + frequency_validator = EnumAttributeValidator.new('String', ["once", "recurring", "forever"]) return false unless frequency_validator.valid?(@frequency) return false if !@percentage_rate.nil? && @percentage_rate !~ Regexp.new(/^[0-9]+.?[0-9]*$/) true @@ -182,7 +182,7 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] frequency Object to be assigned def frequency=(frequency) - validator = EnumAttributeValidator.new('String', ["once", "recurring"]) + validator = EnumAttributeValidator.new('String', ["once", "recurring", "forever"]) unless validator.valid?(frequency) fail ArgumentError, "invalid value for \"frequency\", must be one of #{validator.allowable_values}." end diff --git a/ruby/lib/lago_ruby/models/applied_coupon_object.rb b/ruby/lib/lago_ruby/models/applied_coupon_object.rb index 85565b9..39271e5 100644 --- a/ruby/lib/lago_ruby/models/applied_coupon_object.rb +++ b/ruby/lib/lago_ruby/models/applied_coupon_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -317,7 +317,7 @@ def valid? return false unless status_validator.valid?(@status) return false if !@percentage_rate.nil? && @percentage_rate !~ Regexp.new(/^[0-9]+.?[0-9]*$/) return false if @frequency.nil? - frequency_validator = EnumAttributeValidator.new('String', ["once", "recurring"]) + frequency_validator = EnumAttributeValidator.new('String', ["once", "recurring", "forever"]) return false unless frequency_validator.valid?(@frequency) return false if @created_at.nil? true @@ -347,7 +347,7 @@ def percentage_rate=(percentage_rate) # Custom attribute writer method checking allowed values (enum). # @param [Object] frequency Object to be assigned def frequency=(frequency) - validator = EnumAttributeValidator.new('String', ["once", "recurring"]) + validator = EnumAttributeValidator.new('String', ["once", "recurring", "forever"]) unless validator.valid?(frequency) fail ArgumentError, "invalid value for \"frequency\", must be one of #{validator.allowable_values}." end diff --git a/ruby/lib/lago_ruby/models/applied_coupon_object_extended.rb b/ruby/lib/lago_ruby/models/applied_coupon_object_extended.rb index 2b37a26..e35ffa2 100644 --- a/ruby/lib/lago_ruby/models/applied_coupon_object_extended.rb +++ b/ruby/lib/lago_ruby/models/applied_coupon_object_extended.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -340,7 +340,7 @@ def valid? return false unless status_validator.valid?(@status) return false if !@percentage_rate.nil? && @percentage_rate !~ Regexp.new(/^[0-9]+.?[0-9]*$/) return false if @frequency.nil? - frequency_validator = EnumAttributeValidator.new('String', ["once", "recurring"]) + frequency_validator = EnumAttributeValidator.new('String', ["once", "recurring", "forever"]) return false unless frequency_validator.valid?(@frequency) return false if @created_at.nil? return false if @credits.nil? @@ -371,7 +371,7 @@ def percentage_rate=(percentage_rate) # Custom attribute writer method checking allowed values (enum). # @param [Object] frequency Object to be assigned def frequency=(frequency) - validator = EnumAttributeValidator.new('String', ["once", "recurring"]) + validator = EnumAttributeValidator.new('String', ["once", "recurring", "forever"]) unless validator.valid?(frequency) fail ArgumentError, "invalid value for \"frequency\", must be one of #{validator.allowable_values}." end diff --git a/ruby/lib/lago_ruby/models/applied_coupons_paginated.rb b/ruby/lib/lago_ruby/models/applied_coupons_paginated.rb index 18c972a..640be6a 100644 --- a/ruby/lib/lago_ruby/models/applied_coupons_paginated.rb +++ b/ruby/lib/lago_ruby/models/applied_coupons_paginated.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/base_applied_tax.rb b/ruby/lib/lago_ruby/models/base_applied_tax.rb index b1ebfe2..2dd7ddd 100644 --- a/ruby/lib/lago_ruby/models/base_applied_tax.rb +++ b/ruby/lib/lago_ruby/models/base_applied_tax.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/billable_metric.rb b/ruby/lib/lago_ruby/models/billable_metric.rb index acbcf28..e335cef 100644 --- a/ruby/lib/lago_ruby/models/billable_metric.rb +++ b/ruby/lib/lago_ruby/models/billable_metric.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/billable_metric_base_input.rb b/ruby/lib/lago_ruby/models/billable_metric_base_input.rb index 191b526..3972b03 100644 --- a/ruby/lib/lago_ruby/models/billable_metric_base_input.rb +++ b/ruby/lib/lago_ruby/models/billable_metric_base_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/billable_metric_create_input.rb b/ruby/lib/lago_ruby/models/billable_metric_create_input.rb index e4bb16f..e8b66a0 100644 --- a/ruby/lib/lago_ruby/models/billable_metric_create_input.rb +++ b/ruby/lib/lago_ruby/models/billable_metric_create_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/billable_metric_create_input_billable_metric.rb b/ruby/lib/lago_ruby/models/billable_metric_create_input_billable_metric.rb index ffefdba..b9acf45 100644 --- a/ruby/lib/lago_ruby/models/billable_metric_create_input_billable_metric.rb +++ b/ruby/lib/lago_ruby/models/billable_metric_create_input_billable_metric.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/billable_metric_group.rb b/ruby/lib/lago_ruby/models/billable_metric_group.rb index 1dd0fc3..229a867 100644 --- a/ruby/lib/lago_ruby/models/billable_metric_group.rb +++ b/ruby/lib/lago_ruby/models/billable_metric_group.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/billable_metric_group_values_inner.rb b/ruby/lib/lago_ruby/models/billable_metric_group_values_inner.rb index e9c11da..578af83 100644 --- a/ruby/lib/lago_ruby/models/billable_metric_group_values_inner.rb +++ b/ruby/lib/lago_ruby/models/billable_metric_group_values_inner.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -88,7 +88,7 @@ def find_and_cast_into_type(klass, data) return model if model else # raise if data contains keys that are not known to the model - raise unless (data.keys - const.acceptable_attributes).empty? + raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty? model = const.build_from_hash(data) return model if model end diff --git a/ruby/lib/lago_ruby/models/billable_metric_group_values_inner_one_of.rb b/ruby/lib/lago_ruby/models/billable_metric_group_values_inner_one_of.rb index 3e23508..06d1e13 100644 --- a/ruby/lib/lago_ruby/models/billable_metric_group_values_inner_one_of.rb +++ b/ruby/lib/lago_ruby/models/billable_metric_group_values_inner_one_of.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/billable_metric_object.rb b/ruby/lib/lago_ruby/models/billable_metric_object.rb index fcb9875..61e6e03 100644 --- a/ruby/lib/lago_ruby/models/billable_metric_object.rb +++ b/ruby/lib/lago_ruby/models/billable_metric_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/billable_metric_update_input.rb b/ruby/lib/lago_ruby/models/billable_metric_update_input.rb index 1610ac0..200c64e 100644 --- a/ruby/lib/lago_ruby/models/billable_metric_update_input.rb +++ b/ruby/lib/lago_ruby/models/billable_metric_update_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/billable_metrics_paginated.rb b/ruby/lib/lago_ruby/models/billable_metrics_paginated.rb index 72eaeac..7b7129e 100644 --- a/ruby/lib/lago_ruby/models/billable_metrics_paginated.rb +++ b/ruby/lib/lago_ruby/models/billable_metrics_paginated.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/charge_object.rb b/ruby/lib/lago_ruby/models/charge_object.rb index 73c44d3..7337bdb 100644 --- a/ruby/lib/lago_ruby/models/charge_object.rb +++ b/ruby/lib/lago_ruby/models/charge_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/charge_object_properties.rb b/ruby/lib/lago_ruby/models/charge_object_properties.rb index 203a6df..cccb5c5 100644 --- a/ruby/lib/lago_ruby/models/charge_object_properties.rb +++ b/ruby/lib/lago_ruby/models/charge_object_properties.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -48,6 +48,9 @@ class ChargeObjectProperties # Specifies the minimum allowable spending for a single transaction. Working as a transaction floor. attr_accessor :per_transaction_min_amount + # The list of event properties that are used to group the events on the invoice for a `standard` charge model. + attr_accessor :grouped_by + # Volume ranges, sorted from bottom to top tiers, used for a `volume` charge model. attr_accessor :volume_ranges @@ -65,6 +68,7 @@ def self.attribute_map :'free_units_per_total_aggregation' => :'free_units_per_total_aggregation', :'per_transaction_max_amount' => :'per_transaction_max_amount', :'per_transaction_min_amount' => :'per_transaction_min_amount', + :'grouped_by' => :'grouped_by', :'volume_ranges' => :'volume_ranges' } end @@ -88,6 +92,7 @@ def self.openapi_types :'free_units_per_total_aggregation' => :'String', :'per_transaction_max_amount' => :'String', :'per_transaction_min_amount' => :'String', + :'grouped_by' => :'Array', :'volume_ranges' => :'Array' } end @@ -172,6 +177,12 @@ def initialize(attributes = {}) self.per_transaction_min_amount = attributes[:'per_transaction_min_amount'] end + if attributes.key?(:'grouped_by') + if (value = attributes[:'grouped_by']).is_a?(Array) + self.grouped_by = value + end + end + if attributes.key?(:'volume_ranges') if (value = attributes[:'volume_ranges']).is_a?(Array) self.volume_ranges = value @@ -290,6 +301,7 @@ def ==(o) free_units_per_total_aggregation == o.free_units_per_total_aggregation && per_transaction_max_amount == o.per_transaction_max_amount && per_transaction_min_amount == o.per_transaction_min_amount && + grouped_by == o.grouped_by && volume_ranges == o.volume_ranges end @@ -302,7 +314,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [graduated_ranges, graduated_percentage_ranges, amount, free_units, package_size, rate, fixed_amount, free_units_per_events, free_units_per_total_aggregation, per_transaction_max_amount, per_transaction_min_amount, volume_ranges].hash + [graduated_ranges, graduated_percentage_ranges, amount, free_units, package_size, rate, fixed_amount, free_units_per_events, free_units_per_total_aggregation, per_transaction_max_amount, per_transaction_min_amount, grouped_by, volume_ranges].hash end # Builds the object from hash diff --git a/ruby/lib/lago_ruby/models/charge_properties.rb b/ruby/lib/lago_ruby/models/charge_properties.rb index e3dcaac..13cc8da 100644 --- a/ruby/lib/lago_ruby/models/charge_properties.rb +++ b/ruby/lib/lago_ruby/models/charge_properties.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -48,6 +48,9 @@ class ChargeProperties # Specifies the minimum allowable spending for a single transaction. Working as a transaction floor. attr_accessor :per_transaction_min_amount + # The list of event properties that are used to group the events on the invoice for a `standard` charge model. + attr_accessor :grouped_by + # Volume ranges, sorted from bottom to top tiers, used for a `volume` charge model. attr_accessor :volume_ranges @@ -65,6 +68,7 @@ def self.attribute_map :'free_units_per_total_aggregation' => :'free_units_per_total_aggregation', :'per_transaction_max_amount' => :'per_transaction_max_amount', :'per_transaction_min_amount' => :'per_transaction_min_amount', + :'grouped_by' => :'grouped_by', :'volume_ranges' => :'volume_ranges' } end @@ -88,6 +92,7 @@ def self.openapi_types :'free_units_per_total_aggregation' => :'String', :'per_transaction_max_amount' => :'String', :'per_transaction_min_amount' => :'String', + :'grouped_by' => :'Array', :'volume_ranges' => :'Array' } end @@ -165,6 +170,12 @@ def initialize(attributes = {}) self.per_transaction_min_amount = attributes[:'per_transaction_min_amount'] end + if attributes.key?(:'grouped_by') + if (value = attributes[:'grouped_by']).is_a?(Array) + self.grouped_by = value + end + end + if attributes.key?(:'volume_ranges') if (value = attributes[:'volume_ranges']).is_a?(Array) self.volume_ranges = value @@ -283,6 +294,7 @@ def ==(o) free_units_per_total_aggregation == o.free_units_per_total_aggregation && per_transaction_max_amount == o.per_transaction_max_amount && per_transaction_min_amount == o.per_transaction_min_amount && + grouped_by == o.grouped_by && volume_ranges == o.volume_ranges end @@ -295,7 +307,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [graduated_ranges, graduated_percentage_ranges, amount, free_units, package_size, rate, fixed_amount, free_units_per_events, free_units_per_total_aggregation, per_transaction_max_amount, per_transaction_min_amount, volume_ranges].hash + [graduated_ranges, graduated_percentage_ranges, amount, free_units, package_size, rate, fixed_amount, free_units_per_events, free_units_per_total_aggregation, per_transaction_max_amount, per_transaction_min_amount, grouped_by, volume_ranges].hash end # Builds the object from hash diff --git a/ruby/lib/lago_ruby/models/charge_properties_graduated_percentage_ranges_inner.rb b/ruby/lib/lago_ruby/models/charge_properties_graduated_percentage_ranges_inner.rb index e29e867..954f011 100644 --- a/ruby/lib/lago_ruby/models/charge_properties_graduated_percentage_ranges_inner.rb +++ b/ruby/lib/lago_ruby/models/charge_properties_graduated_percentage_ranges_inner.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/charge_properties_graduated_ranges_inner.rb b/ruby/lib/lago_ruby/models/charge_properties_graduated_ranges_inner.rb index 2e6d1ce..9a808db 100644 --- a/ruby/lib/lago_ruby/models/charge_properties_graduated_ranges_inner.rb +++ b/ruby/lib/lago_ruby/models/charge_properties_graduated_ranges_inner.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/charge_properties_volume_ranges_inner.rb b/ruby/lib/lago_ruby/models/charge_properties_volume_ranges_inner.rb index 7a695cf..9e0ebee 100644 --- a/ruby/lib/lago_ruby/models/charge_properties_volume_ranges_inner.rb +++ b/ruby/lib/lago_ruby/models/charge_properties_volume_ranges_inner.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/country.rb b/ruby/lib/lago_ruby/models/country.rb index 7cd0678..c1a93ba 100644 --- a/ruby/lib/lago_ruby/models/country.rb +++ b/ruby/lib/lago_ruby/models/country.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/coupon.rb b/ruby/lib/lago_ruby/models/coupon.rb index 26437bc..a2a2516 100644 --- a/ruby/lib/lago_ruby/models/coupon.rb +++ b/ruby/lib/lago_ruby/models/coupon.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/coupon_base_input.rb b/ruby/lib/lago_ruby/models/coupon_base_input.rb index c5fe0f8..a49df9e 100644 --- a/ruby/lib/lago_ruby/models/coupon_base_input.rb +++ b/ruby/lib/lago_ruby/models/coupon_base_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -217,7 +217,7 @@ def valid? coupon_type_validator = EnumAttributeValidator.new('String', ["fixed_amount", "percentage"]) return false unless coupon_type_validator.valid?(@coupon_type) return false if !@percentage_rate.nil? && @percentage_rate !~ Regexp.new(/^[0-9]+.?[0-9]*$/) - frequency_validator = EnumAttributeValidator.new('String', ["once", "recurring"]) + frequency_validator = EnumAttributeValidator.new('String', ["once", "recurring", "forever"]) return false unless frequency_validator.valid?(@frequency) expiration_validator = EnumAttributeValidator.new('String', ["no_expiration", "time_limit"]) return false unless expiration_validator.valid?(@expiration) @@ -248,7 +248,7 @@ def percentage_rate=(percentage_rate) # Custom attribute writer method checking allowed values (enum). # @param [Object] frequency Object to be assigned def frequency=(frequency) - validator = EnumAttributeValidator.new('String', ["once", "recurring"]) + validator = EnumAttributeValidator.new('String', ["once", "recurring", "forever"]) unless validator.valid?(frequency) fail ArgumentError, "invalid value for \"frequency\", must be one of #{validator.allowable_values}." end diff --git a/ruby/lib/lago_ruby/models/coupon_base_input_applies_to.rb b/ruby/lib/lago_ruby/models/coupon_base_input_applies_to.rb index fb91f46..b06dc18 100644 --- a/ruby/lib/lago_ruby/models/coupon_base_input_applies_to.rb +++ b/ruby/lib/lago_ruby/models/coupon_base_input_applies_to.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/coupon_create_input.rb b/ruby/lib/lago_ruby/models/coupon_create_input.rb index 68bdaad..c1bd332 100644 --- a/ruby/lib/lago_ruby/models/coupon_create_input.rb +++ b/ruby/lib/lago_ruby/models/coupon_create_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/coupon_create_input_coupon.rb b/ruby/lib/lago_ruby/models/coupon_create_input_coupon.rb index 0e11072..1b66c27 100644 --- a/ruby/lib/lago_ruby/models/coupon_create_input_coupon.rb +++ b/ruby/lib/lago_ruby/models/coupon_create_input_coupon.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -252,7 +252,7 @@ def valid? return false unless coupon_type_validator.valid?(@coupon_type) return false if !@percentage_rate.nil? && @percentage_rate !~ Regexp.new(/^[0-9]+.?[0-9]*$/) return false if @frequency.nil? - frequency_validator = EnumAttributeValidator.new('String', ["once", "recurring"]) + frequency_validator = EnumAttributeValidator.new('String', ["once", "recurring", "forever"]) return false unless frequency_validator.valid?(@frequency) expiration_validator = EnumAttributeValidator.new('String', ["no_expiration", "time_limit"]) return false unless expiration_validator.valid?(@expiration) @@ -283,7 +283,7 @@ def percentage_rate=(percentage_rate) # Custom attribute writer method checking allowed values (enum). # @param [Object] frequency Object to be assigned def frequency=(frequency) - validator = EnumAttributeValidator.new('String', ["once", "recurring"]) + validator = EnumAttributeValidator.new('String', ["once", "recurring", "forever"]) unless validator.valid?(frequency) fail ArgumentError, "invalid value for \"frequency\", must be one of #{validator.allowable_values}." end diff --git a/ruby/lib/lago_ruby/models/coupon_object.rb b/ruby/lib/lago_ruby/models/coupon_object.rb index 7b2ea68..92f7fee 100644 --- a/ruby/lib/lago_ruby/models/coupon_object.rb +++ b/ruby/lib/lago_ruby/models/coupon_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -343,7 +343,7 @@ def valid? return false if @limited_billable_metrics.nil? return false if !@percentage_rate.nil? && @percentage_rate !~ Regexp.new(/^[0-9]+.?[0-9]*$/) return false if @frequency.nil? - frequency_validator = EnumAttributeValidator.new('String', ["once", "recurring"]) + frequency_validator = EnumAttributeValidator.new('String', ["once", "recurring", "forever"]) return false unless frequency_validator.valid?(@frequency) return false if @expiration.nil? expiration_validator = EnumAttributeValidator.new('String', ["no_expiration", "time_limit"]) @@ -376,7 +376,7 @@ def percentage_rate=(percentage_rate) # Custom attribute writer method checking allowed values (enum). # @param [Object] frequency Object to be assigned def frequency=(frequency) - validator = EnumAttributeValidator.new('String', ["once", "recurring"]) + validator = EnumAttributeValidator.new('String', ["once", "recurring", "forever"]) unless validator.valid?(frequency) fail ArgumentError, "invalid value for \"frequency\", must be one of #{validator.allowable_values}." end diff --git a/ruby/lib/lago_ruby/models/coupon_update_input.rb b/ruby/lib/lago_ruby/models/coupon_update_input.rb index dbab151..8b7c587 100644 --- a/ruby/lib/lago_ruby/models/coupon_update_input.rb +++ b/ruby/lib/lago_ruby/models/coupon_update_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/coupons_paginated.rb b/ruby/lib/lago_ruby/models/coupons_paginated.rb index 5793cd4..caf517c 100644 --- a/ruby/lib/lago_ruby/models/coupons_paginated.rb +++ b/ruby/lib/lago_ruby/models/coupons_paginated.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/credit_note.rb b/ruby/lib/lago_ruby/models/credit_note.rb index ae09698..5dfd07a 100644 --- a/ruby/lib/lago_ruby/models/credit_note.rb +++ b/ruby/lib/lago_ruby/models/credit_note.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/credit_note_applied_tax_object.rb b/ruby/lib/lago_ruby/models/credit_note_applied_tax_object.rb index 84c21e7..35e1484 100644 --- a/ruby/lib/lago_ruby/models/credit_note_applied_tax_object.rb +++ b/ruby/lib/lago_ruby/models/credit_note_applied_tax_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/credit_note_create_input.rb b/ruby/lib/lago_ruby/models/credit_note_create_input.rb index dc9a2af..52bacb5 100644 --- a/ruby/lib/lago_ruby/models/credit_note_create_input.rb +++ b/ruby/lib/lago_ruby/models/credit_note_create_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/credit_note_create_input_credit_note.rb b/ruby/lib/lago_ruby/models/credit_note_create_input_credit_note.rb index 879249e..b7a9544 100644 --- a/ruby/lib/lago_ruby/models/credit_note_create_input_credit_note.rb +++ b/ruby/lib/lago_ruby/models/credit_note_create_input_credit_note.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/credit_note_estimate_input.rb b/ruby/lib/lago_ruby/models/credit_note_estimate_input.rb index 3a46c3b..46bb9e6 100644 --- a/ruby/lib/lago_ruby/models/credit_note_estimate_input.rb +++ b/ruby/lib/lago_ruby/models/credit_note_estimate_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/credit_note_estimate_input_credit_note.rb b/ruby/lib/lago_ruby/models/credit_note_estimate_input_credit_note.rb index f9e267d..bd5a18b 100644 --- a/ruby/lib/lago_ruby/models/credit_note_estimate_input_credit_note.rb +++ b/ruby/lib/lago_ruby/models/credit_note_estimate_input_credit_note.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/credit_note_estimate_input_credit_note_items_inner.rb b/ruby/lib/lago_ruby/models/credit_note_estimate_input_credit_note_items_inner.rb index a499928..a95421d 100644 --- a/ruby/lib/lago_ruby/models/credit_note_estimate_input_credit_note_items_inner.rb +++ b/ruby/lib/lago_ruby/models/credit_note_estimate_input_credit_note_items_inner.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/credit_note_estimated.rb b/ruby/lib/lago_ruby/models/credit_note_estimated.rb index 0a9c789..b5f0a03 100644 --- a/ruby/lib/lago_ruby/models/credit_note_estimated.rb +++ b/ruby/lib/lago_ruby/models/credit_note_estimated.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/credit_note_estimated_estimated_credit_note.rb b/ruby/lib/lago_ruby/models/credit_note_estimated_estimated_credit_note.rb index b3d5657..43dba33 100644 --- a/ruby/lib/lago_ruby/models/credit_note_estimated_estimated_credit_note.rb +++ b/ruby/lib/lago_ruby/models/credit_note_estimated_estimated_credit_note.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/credit_note_estimated_estimated_credit_note_applied_taxes_inner.rb b/ruby/lib/lago_ruby/models/credit_note_estimated_estimated_credit_note_applied_taxes_inner.rb index ccd3d18..b3497a3 100644 --- a/ruby/lib/lago_ruby/models/credit_note_estimated_estimated_credit_note_applied_taxes_inner.rb +++ b/ruby/lib/lago_ruby/models/credit_note_estimated_estimated_credit_note_applied_taxes_inner.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/credit_note_estimated_estimated_credit_note_items_inner.rb b/ruby/lib/lago_ruby/models/credit_note_estimated_estimated_credit_note_items_inner.rb index 783816b..817ea8f 100644 --- a/ruby/lib/lago_ruby/models/credit_note_estimated_estimated_credit_note_items_inner.rb +++ b/ruby/lib/lago_ruby/models/credit_note_estimated_estimated_credit_note_items_inner.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/credit_note_item_object.rb b/ruby/lib/lago_ruby/models/credit_note_item_object.rb index e7fc2e2..79d7b22 100644 --- a/ruby/lib/lago_ruby/models/credit_note_item_object.rb +++ b/ruby/lib/lago_ruby/models/credit_note_item_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/credit_note_item_object_fee.rb b/ruby/lib/lago_ruby/models/credit_note_item_object_fee.rb index 58b8d00..0efa2fe 100644 --- a/ruby/lib/lago_ruby/models/credit_note_item_object_fee.rb +++ b/ruby/lib/lago_ruby/models/credit_note_item_object_fee.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -100,6 +100,8 @@ class CreditNoteItemObjectFee # Unique identifier assigned to the transaction. This field is specifically displayed when the fee type is `charge` and the payment for the fee is made in advance (`pay_in_advance` is set to `true`). attr_accessor :event_transaction_id + attr_accessor :amount_details + attr_accessor :item # List of fee applied taxes @@ -159,6 +161,7 @@ def self.attribute_map :'failed_at' => :'failed_at', :'refunded_at' => :'refunded_at', :'event_transaction_id' => :'event_transaction_id', + :'amount_details' => :'amount_details', :'item' => :'item', :'applied_taxes' => :'applied_taxes' } @@ -201,6 +204,7 @@ def self.openapi_types :'failed_at' => :'Time', :'refunded_at' => :'Time', :'event_transaction_id' => :'String', + :'amount_details' => :'FeeObjectAmountDetails', :'item' => :'FeeObjectItem', :'applied_taxes' => :'Array' } @@ -388,6 +392,10 @@ def initialize(attributes = {}) self.event_transaction_id = attributes[:'event_transaction_id'] end + if attributes.key?(:'amount_details') + self.amount_details = attributes[:'amount_details'] + end + if attributes.key?(:'item') self.item = attributes[:'item'] else @@ -522,6 +530,7 @@ def ==(o) failed_at == o.failed_at && refunded_at == o.refunded_at && event_transaction_id == o.event_transaction_id && + amount_details == o.amount_details && item == o.item && applied_taxes == o.applied_taxes end @@ -535,7 +544,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [lago_id, lago_group_id, lago_invoice_id, lago_true_up_fee_id, lago_true_up_parent_fee_id, lago_subscription_id, lago_customer_id, external_customer_id, external_subscription_id, invoice_display_name, amount_cents, amount_currency, taxes_amount_cents, taxes_rate, units, precise_unit_amount, total_amount_cents, total_amount_currency, events_count, pay_in_advance, invoiceable, from_date, to_date, payment_status, created_at, succeeded_at, failed_at, refunded_at, event_transaction_id, item, applied_taxes].hash + [lago_id, lago_group_id, lago_invoice_id, lago_true_up_fee_id, lago_true_up_parent_fee_id, lago_subscription_id, lago_customer_id, external_customer_id, external_subscription_id, invoice_display_name, amount_cents, amount_currency, taxes_amount_cents, taxes_rate, units, precise_unit_amount, total_amount_cents, total_amount_currency, events_count, pay_in_advance, invoiceable, from_date, to_date, payment_status, created_at, succeeded_at, failed_at, refunded_at, event_transaction_id, amount_details, item, applied_taxes].hash end # Builds the object from hash diff --git a/ruby/lib/lago_ruby/models/credit_note_object.rb b/ruby/lib/lago_ruby/models/credit_note_object.rb index 52fe69f..4b22a15 100644 --- a/ruby/lib/lago_ruby/models/credit_note_object.rb +++ b/ruby/lib/lago_ruby/models/credit_note_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/credit_note_update_input.rb b/ruby/lib/lago_ruby/models/credit_note_update_input.rb index 8b776e7..5e18860 100644 --- a/ruby/lib/lago_ruby/models/credit_note_update_input.rb +++ b/ruby/lib/lago_ruby/models/credit_note_update_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/credit_note_update_input_credit_note.rb b/ruby/lib/lago_ruby/models/credit_note_update_input_credit_note.rb index 3e638c4..26215ae 100644 --- a/ruby/lib/lago_ruby/models/credit_note_update_input_credit_note.rb +++ b/ruby/lib/lago_ruby/models/credit_note_update_input_credit_note.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/credit_notes.rb b/ruby/lib/lago_ruby/models/credit_notes.rb index ec21af2..9fba44a 100644 --- a/ruby/lib/lago_ruby/models/credit_notes.rb +++ b/ruby/lib/lago_ruby/models/credit_notes.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/credit_object.rb b/ruby/lib/lago_ruby/models/credit_object.rb index 97c4ed1..30a7fbb 100644 --- a/ruby/lib/lago_ruby/models/credit_object.rb +++ b/ruby/lib/lago_ruby/models/credit_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/credit_object_invoice.rb b/ruby/lib/lago_ruby/models/credit_object_invoice.rb index c3707e0..f232354 100644 --- a/ruby/lib/lago_ruby/models/credit_object_invoice.rb +++ b/ruby/lib/lago_ruby/models/credit_object_invoice.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/credit_object_item.rb b/ruby/lib/lago_ruby/models/credit_object_item.rb index 22fe2f7..48f259b 100644 --- a/ruby/lib/lago_ruby/models/credit_object_item.rb +++ b/ruby/lib/lago_ruby/models/credit_object_item.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/currency.rb b/ruby/lib/lago_ruby/models/currency.rb index 459e6c8..8d4b984 100644 --- a/ruby/lib/lago_ruby/models/currency.rb +++ b/ruby/lib/lago_ruby/models/currency.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/customer.rb b/ruby/lib/lago_ruby/models/customer.rb index aa223b0..4807eb0 100644 --- a/ruby/lib/lago_ruby/models/customer.rb +++ b/ruby/lib/lago_ruby/models/customer.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/customer_billing_configuration.rb b/ruby/lib/lago_ruby/models/customer_billing_configuration.rb index d306a04..10c578c 100644 --- a/ruby/lib/lago_ruby/models/customer_billing_configuration.rb +++ b/ruby/lib/lago_ruby/models/customer_billing_configuration.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -22,6 +22,9 @@ class CustomerBillingConfiguration # The payment provider utilized to initiate payments for invoices issued by Lago. Accepted values: `stripe`, `adyen`, `gocardless` or null. This field is required if you intend to assign a `provider_customer_id`. attr_accessor :payment_provider + # Unique code used to identify a payment provider connection. + attr_accessor :payment_provider_code + # The customer ID within the payment provider's system. If this field is not provided, Lago has the option to create a new customer record within the payment provider's system on behalf of the customer attr_accessor :provider_customer_id @@ -64,6 +67,7 @@ def self.attribute_map { :'invoice_grace_period' => :'invoice_grace_period', :'payment_provider' => :'payment_provider', + :'payment_provider_code' => :'payment_provider_code', :'provider_customer_id' => :'provider_customer_id', :'sync' => :'sync', :'sync_with_provider' => :'sync_with_provider', @@ -82,6 +86,7 @@ def self.openapi_types { :'invoice_grace_period' => :'Integer', :'payment_provider' => :'String', + :'payment_provider_code' => :'String', :'provider_customer_id' => :'String', :'sync' => :'Boolean', :'sync_with_provider' => :'Boolean', @@ -120,6 +125,10 @@ def initialize(attributes = {}) self.payment_provider = attributes[:'payment_provider'] end + if attributes.key?(:'payment_provider_code') + self.payment_provider_code = attributes[:'payment_provider_code'] + end + if attributes.key?(:'provider_customer_id') self.provider_customer_id = attributes[:'provider_customer_id'] end @@ -177,6 +186,7 @@ def ==(o) self.class == o.class && invoice_grace_period == o.invoice_grace_period && payment_provider == o.payment_provider && + payment_provider_code == o.payment_provider_code && provider_customer_id == o.provider_customer_id && sync == o.sync && sync_with_provider == o.sync_with_provider && @@ -193,7 +203,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [invoice_grace_period, payment_provider, provider_customer_id, sync, sync_with_provider, document_locale, provider_payment_methods].hash + [invoice_grace_period, payment_provider, payment_provider_code, provider_customer_id, sync, sync_with_provider, document_locale, provider_payment_methods].hash end # Builds the object from hash diff --git a/ruby/lib/lago_ruby/models/customer_charge_grouped_usage_object_inner.rb b/ruby/lib/lago_ruby/models/customer_charge_grouped_usage_object_inner.rb new file mode 100644 index 0000000..a274bf7 --- /dev/null +++ b/ruby/lib/lago_ruby/models/customer_charge_grouped_usage_object_inner.rb @@ -0,0 +1,280 @@ +=begin +#Lago API documentation + +#Lago API allows your application to push customer information and metrics (events) from your application to the billing application. + +The version of the OpenAPI document: 0.53.0-beta +Contact: tech@getlago.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.4.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module LagoAPI + class CustomerChargeGroupedUsageObjectInner + # The amount in cents, tax excluded, consumed for a specific group related to a charge item. + attr_accessor :amount_cents + + # The quantity of usage events that have been recorded for a particular charge during the specified time period. These events may also be referred to as the number of transactions in some contexts. + attr_accessor :events_count + + # The number of units consumed for a specific group related to a charge item. + attr_accessor :units + + # Key value list of event properties aggregated by the charge model + attr_accessor :grouped_by + + # Array of group object, representing multiple dimensions for a charge item. + attr_accessor :groups + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'amount_cents' => :'amount_cents', + :'events_count' => :'events_count', + :'units' => :'units', + :'grouped_by' => :'grouped_by', + :'groups' => :'groups' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'amount_cents' => :'Integer', + :'events_count' => :'Integer', + :'units' => :'String', + :'grouped_by' => :'Hash', + :'groups' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `LagoAPI::CustomerChargeGroupedUsageObjectInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `LagoAPI::CustomerChargeGroupedUsageObjectInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'amount_cents') + self.amount_cents = attributes[:'amount_cents'] + end + + if attributes.key?(:'events_count') + self.events_count = attributes[:'events_count'] + end + + if attributes.key?(:'units') + self.units = attributes[:'units'] + end + + if attributes.key?(:'grouped_by') + if (value = attributes[:'grouped_by']).is_a?(Hash) + self.grouped_by = value + end + end + + if attributes.key?(:'groups') + if (value = attributes[:'groups']).is_a?(Array) + self.groups = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if !@units.nil? && @units !~ pattern + invalid_properties.push("invalid value for \"units\", must conform to the pattern #{pattern}.") + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if !@units.nil? && @units !~ Regexp.new(/^[0-9]+.?[0-9]*$/) + true + end + + # Custom attribute writer method with validation + # @param [Object] units Value to be assigned + def units=(units) + if units.nil? + fail ArgumentError, 'units cannot be nil' + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if units !~ pattern + fail ArgumentError, "invalid value for \"units\", must conform to the pattern #{pattern}." + end + + @units = units + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + amount_cents == o.amount_cents && + events_count == o.events_count && + units == o.units && + grouped_by == o.grouped_by && + groups == o.groups + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [amount_cents, events_count, units, grouped_by, groups].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = LagoAPI.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby/lib/lago_ruby/models/customer_charge_groups_usage_object_inner.rb b/ruby/lib/lago_ruby/models/customer_charge_groups_usage_object_inner.rb new file mode 100644 index 0000000..8a80388 --- /dev/null +++ b/ruby/lib/lago_ruby/models/customer_charge_groups_usage_object_inner.rb @@ -0,0 +1,287 @@ +=begin +#Lago API documentation + +#Lago API allows your application to push customer information and metrics (events) from your application to the billing application. + +The version of the OpenAPI document: 0.53.0-beta +Contact: tech@getlago.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.4.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module LagoAPI + class CustomerChargeGroupsUsageObjectInner + # Unique identifier assigned to the group within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the group record within the Lago system. + attr_accessor :lago_id + + # The group key, only returned for groups with two dimensions. + attr_accessor :key + + # The group value. + attr_accessor :value + + # The number of units consumed for a specific group related to a charge item. + attr_accessor :units + + # The quantity of usage events that have been recorded for a particular charge during the specified time period. These events may also be referred to as the number of transactions in some contexts. + attr_accessor :events_count + + # The amount in cents, tax excluded, consumed for a specific group related to a charge item. + attr_accessor :amount_cents + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'lago_id' => :'lago_id', + :'key' => :'key', + :'value' => :'value', + :'units' => :'units', + :'events_count' => :'events_count', + :'amount_cents' => :'amount_cents' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'lago_id' => :'String', + :'key' => :'String', + :'value' => :'String', + :'units' => :'String', + :'events_count' => :'Integer', + :'amount_cents' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'key', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `LagoAPI::CustomerChargeGroupsUsageObjectInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `LagoAPI::CustomerChargeGroupsUsageObjectInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'lago_id') + self.lago_id = attributes[:'lago_id'] + end + + if attributes.key?(:'key') + self.key = attributes[:'key'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + + if attributes.key?(:'units') + self.units = attributes[:'units'] + end + + if attributes.key?(:'events_count') + self.events_count = attributes[:'events_count'] + end + + if attributes.key?(:'amount_cents') + self.amount_cents = attributes[:'amount_cents'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if !@units.nil? && @units !~ pattern + invalid_properties.push("invalid value for \"units\", must conform to the pattern #{pattern}.") + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if !@units.nil? && @units !~ Regexp.new(/^[0-9]+.?[0-9]*$/) + true + end + + # Custom attribute writer method with validation + # @param [Object] units Value to be assigned + def units=(units) + if units.nil? + fail ArgumentError, 'units cannot be nil' + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if units !~ pattern + fail ArgumentError, "invalid value for \"units\", must conform to the pattern #{pattern}." + end + + @units = units + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + lago_id == o.lago_id && + key == o.key && + value == o.value && + units == o.units && + events_count == o.events_count && + amount_cents == o.amount_cents + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [lago_id, key, value, units, events_count, amount_cents].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = LagoAPI.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby/lib/lago_ruby/models/customer_charge_usage_object.rb b/ruby/lib/lago_ruby/models/customer_charge_usage_object.rb index d110ad6..587f1f4 100644 --- a/ruby/lib/lago_ruby/models/customer_charge_usage_object.rb +++ b/ruby/lib/lago_ruby/models/customer_charge_usage_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -33,6 +33,9 @@ class CustomerChargeUsageObject # Array of group object, representing multiple dimensions for a charge item. attr_accessor :groups + # Array of aggregated fees, grouped by the event properties defined in a `standard` charge model. + attr_accessor :grouped_usage + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -42,7 +45,8 @@ def self.attribute_map :'amount_currency' => :'amount_currency', :'charge' => :'charge', :'billable_metric' => :'billable_metric', - :'groups' => :'groups' + :'groups' => :'groups', + :'grouped_usage' => :'grouped_usage' } end @@ -60,7 +64,8 @@ def self.openapi_types :'amount_currency' => :'Currency', :'charge' => :'CustomerChargeUsageObjectCharge', :'billable_metric' => :'CustomerChargeUsageObjectBillableMetric', - :'groups' => :'Array' + :'groups' => :'Array', + :'grouped_usage' => :'Array' } end @@ -128,6 +133,12 @@ def initialize(attributes = {}) else self.groups = nil end + + if attributes.key?(:'grouped_usage') + if (value = attributes[:'grouped_usage']).is_a?(Array) + self.grouped_usage = value + end + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -212,7 +223,8 @@ def ==(o) amount_currency == o.amount_currency && charge == o.charge && billable_metric == o.billable_metric && - groups == o.groups + groups == o.groups && + grouped_usage == o.grouped_usage end # @see the `==` method @@ -224,7 +236,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [units, events_count, amount_cents, amount_currency, charge, billable_metric, groups].hash + [units, events_count, amount_cents, amount_currency, charge, billable_metric, groups, grouped_usage].hash end # Builds the object from hash diff --git a/ruby/lib/lago_ruby/models/customer_charge_usage_object_billable_metric.rb b/ruby/lib/lago_ruby/models/customer_charge_usage_object_billable_metric.rb index 0e27a3b..a278137 100644 --- a/ruby/lib/lago_ruby/models/customer_charge_usage_object_billable_metric.rb +++ b/ruby/lib/lago_ruby/models/customer_charge_usage_object_billable_metric.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/customer_charge_usage_object_charge.rb b/ruby/lib/lago_ruby/models/customer_charge_usage_object_charge.rb index 16147ed..72b5407 100644 --- a/ruby/lib/lago_ruby/models/customer_charge_usage_object_charge.rb +++ b/ruby/lib/lago_ruby/models/customer_charge_usage_object_charge.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/customer_create_input.rb b/ruby/lib/lago_ruby/models/customer_create_input.rb index f70191c..79f415a 100644 --- a/ruby/lib/lago_ruby/models/customer_create_input.rb +++ b/ruby/lib/lago_ruby/models/customer_create_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/customer_create_input_customer.rb b/ruby/lib/lago_ruby/models/customer_create_input_customer.rb index e7614d2..1bdb01f 100644 --- a/ruby/lib/lago_ruby/models/customer_create_input_customer.rb +++ b/ruby/lib/lago_ruby/models/customer_create_input_customer.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/customer_create_input_customer_metadata_inner.rb b/ruby/lib/lago_ruby/models/customer_create_input_customer_metadata_inner.rb index 4456178..7f6415d 100644 --- a/ruby/lib/lago_ruby/models/customer_create_input_customer_metadata_inner.rb +++ b/ruby/lib/lago_ruby/models/customer_create_input_customer_metadata_inner.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/customer_metadata.rb b/ruby/lib/lago_ruby/models/customer_metadata.rb index 5b7acb3..d301bf5 100644 --- a/ruby/lib/lago_ruby/models/customer_metadata.rb +++ b/ruby/lib/lago_ruby/models/customer_metadata.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/customer_object.rb b/ruby/lib/lago_ruby/models/customer_object.rb index 331788b..e1a6783 100644 --- a/ruby/lib/lago_ruby/models/customer_object.rb +++ b/ruby/lib/lago_ruby/models/customer_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/customer_object_extended.rb b/ruby/lib/lago_ruby/models/customer_object_extended.rb index e05f9ff..f6ccb66 100644 --- a/ruby/lib/lago_ruby/models/customer_object_extended.rb +++ b/ruby/lib/lago_ruby/models/customer_object_extended.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/customer_past_usage.rb b/ruby/lib/lago_ruby/models/customer_past_usage.rb index 60089e2..e9dea7c 100644 --- a/ruby/lib/lago_ruby/models/customer_past_usage.rb +++ b/ruby/lib/lago_ruby/models/customer_past_usage.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/customer_usage.rb b/ruby/lib/lago_ruby/models/customer_usage.rb index 951ece9..b70eb0a 100644 --- a/ruby/lib/lago_ruby/models/customer_usage.rb +++ b/ruby/lib/lago_ruby/models/customer_usage.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/customer_usage_object.rb b/ruby/lib/lago_ruby/models/customer_usage_object.rb index a750c81..9cde16c 100644 --- a/ruby/lib/lago_ruby/models/customer_usage_object.rb +++ b/ruby/lib/lago_ruby/models/customer_usage_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/customers_paginated.rb b/ruby/lib/lago_ruby/models/customers_paginated.rb index 9d2f63c..5c30819 100644 --- a/ruby/lib/lago_ruby/models/customers_paginated.rb +++ b/ruby/lib/lago_ruby/models/customers_paginated.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/event.rb b/ruby/lib/lago_ruby/models/event.rb index 7d9f4fe..a672414 100644 --- a/ruby/lib/lago_ruby/models/event.rb +++ b/ruby/lib/lago_ruby/models/event.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/event_batch_input.rb b/ruby/lib/lago_ruby/models/event_batch_input.rb index 67653c3..74dd1bf 100644 --- a/ruby/lib/lago_ruby/models/event_batch_input.rb +++ b/ruby/lib/lago_ruby/models/event_batch_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -15,12 +15,12 @@ module LagoAPI class EventBatchInput - attr_accessor :event + attr_accessor :events # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'event' => :'event' + :'events' => :'events' } end @@ -32,7 +32,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'event' => :'EventBatchInputEvent' + :'events' => :'Array' } end @@ -57,10 +57,12 @@ def initialize(attributes = {}) h[k.to_sym] = v } - if attributes.key?(:'event') - self.event = attributes[:'event'] + if attributes.key?(:'events') + if (value = attributes[:'events']).is_a?(Array) + self.events = value + end else - self.event = nil + self.events = nil end end @@ -69,8 +71,8 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @event.nil? - invalid_properties.push('invalid value for "event", event cannot be nil.') + if @events.nil? + invalid_properties.push('invalid value for "events", events cannot be nil.') end invalid_properties @@ -80,7 +82,7 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @event.nil? + return false if @events.nil? true end @@ -89,7 +91,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - event == o.event + events == o.events end # @see the `==` method @@ -101,7 +103,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [event].hash + [events].hash end # Builds the object from hash diff --git a/ruby/lib/lago_ruby/models/event_estimate_fees_input.rb b/ruby/lib/lago_ruby/models/event_estimate_fees_input.rb index 39970a2..47092ce 100644 --- a/ruby/lib/lago_ruby/models/event_estimate_fees_input.rb +++ b/ruby/lib/lago_ruby/models/event_estimate_fees_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/event_estimate_fees_input_event.rb b/ruby/lib/lago_ruby/models/event_estimate_fees_input_event.rb index 570ffac..4c34c60 100644 --- a/ruby/lib/lago_ruby/models/event_estimate_fees_input_event.rb +++ b/ruby/lib/lago_ruby/models/event_estimate_fees_input_event.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/event_input.rb b/ruby/lib/lago_ruby/models/event_input.rb index 62dc3ae..3432aa0 100644 --- a/ruby/lib/lago_ruby/models/event_input.rb +++ b/ruby/lib/lago_ruby/models/event_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/event_input_event.rb b/ruby/lib/lago_ruby/models/event_input_event.rb index 2d09c42..3108c86 100644 --- a/ruby/lib/lago_ruby/models/event_input_event.rb +++ b/ruby/lib/lago_ruby/models/event_input_event.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/event_input_event_timestamp.rb b/ruby/lib/lago_ruby/models/event_input_event_timestamp.rb index 4b495f7..c2433b6 100644 --- a/ruby/lib/lago_ruby/models/event_input_event_timestamp.rb +++ b/ruby/lib/lago_ruby/models/event_input_event_timestamp.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -88,7 +88,7 @@ def find_and_cast_into_type(klass, data) return model if model else # raise if data contains keys that are not known to the model - raise unless (data.keys - const.acceptable_attributes).empty? + raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty? model = const.build_from_hash(data) return model if model end diff --git a/ruby/lib/lago_ruby/models/event_object.rb b/ruby/lib/lago_ruby/models/event_object.rb index 75c8126..7e8eda8 100644 --- a/ruby/lib/lago_ruby/models/event_object.rb +++ b/ruby/lib/lago_ruby/models/event_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/event_object_properties.rb b/ruby/lib/lago_ruby/models/event_object_properties.rb index 02c01c1..b94e340 100644 --- a/ruby/lib/lago_ruby/models/event_object_properties.rb +++ b/ruby/lib/lago_ruby/models/event_object_properties.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/fee.rb b/ruby/lib/lago_ruby/models/fee.rb index 0a40aaf..b03a2a7 100644 --- a/ruby/lib/lago_ruby/models/fee.rb +++ b/ruby/lib/lago_ruby/models/fee.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/fee_applied_tax_object.rb b/ruby/lib/lago_ruby/models/fee_applied_tax_object.rb index b8205a2..d25bfdb 100644 --- a/ruby/lib/lago_ruby/models/fee_applied_tax_object.rb +++ b/ruby/lib/lago_ruby/models/fee_applied_tax_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/fee_object.rb b/ruby/lib/lago_ruby/models/fee_object.rb index 5fe52cc..ef4d7cc 100644 --- a/ruby/lib/lago_ruby/models/fee_object.rb +++ b/ruby/lib/lago_ruby/models/fee_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -100,6 +100,8 @@ class FeeObject # Unique identifier assigned to the transaction. This field is specifically displayed when the fee type is `charge` and the payment for the fee is made in advance (`pay_in_advance` is set to `true`). attr_accessor :event_transaction_id + attr_accessor :amount_details + attr_accessor :item # List of fee applied taxes @@ -159,6 +161,7 @@ def self.attribute_map :'failed_at' => :'failed_at', :'refunded_at' => :'refunded_at', :'event_transaction_id' => :'event_transaction_id', + :'amount_details' => :'amount_details', :'item' => :'item', :'applied_taxes' => :'applied_taxes' } @@ -201,6 +204,7 @@ def self.openapi_types :'failed_at' => :'Time', :'refunded_at' => :'Time', :'event_transaction_id' => :'String', + :'amount_details' => :'FeeObjectAmountDetails', :'item' => :'FeeObjectItem', :'applied_taxes' => :'Array' } @@ -381,6 +385,10 @@ def initialize(attributes = {}) self.event_transaction_id = attributes[:'event_transaction_id'] end + if attributes.key?(:'amount_details') + self.amount_details = attributes[:'amount_details'] + end + if attributes.key?(:'item') self.item = attributes[:'item'] else @@ -515,6 +523,7 @@ def ==(o) failed_at == o.failed_at && refunded_at == o.refunded_at && event_transaction_id == o.event_transaction_id && + amount_details == o.amount_details && item == o.item && applied_taxes == o.applied_taxes end @@ -528,7 +537,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [lago_id, lago_group_id, lago_invoice_id, lago_true_up_fee_id, lago_true_up_parent_fee_id, lago_subscription_id, lago_customer_id, external_customer_id, external_subscription_id, invoice_display_name, amount_cents, amount_currency, taxes_amount_cents, taxes_rate, units, precise_unit_amount, total_amount_cents, total_amount_currency, events_count, pay_in_advance, invoiceable, from_date, to_date, payment_status, created_at, succeeded_at, failed_at, refunded_at, event_transaction_id, item, applied_taxes].hash + [lago_id, lago_group_id, lago_invoice_id, lago_true_up_fee_id, lago_true_up_parent_fee_id, lago_subscription_id, lago_customer_id, external_customer_id, external_subscription_id, invoice_display_name, amount_cents, amount_currency, taxes_amount_cents, taxes_rate, units, precise_unit_amount, total_amount_cents, total_amount_currency, events_count, pay_in_advance, invoiceable, from_date, to_date, payment_status, created_at, succeeded_at, failed_at, refunded_at, event_transaction_id, amount_details, item, applied_taxes].hash end # Builds the object from hash diff --git a/ruby/lib/lago_ruby/models/fee_object_amount_details.rb b/ruby/lib/lago_ruby/models/fee_object_amount_details.rb new file mode 100644 index 0000000..d096ed5 --- /dev/null +++ b/ruby/lib/lago_ruby/models/fee_object_amount_details.rb @@ -0,0 +1,445 @@ +=begin +#Lago API documentation + +#Lago API allows your application to push customer information and metrics (events) from your application to the billing application. + +The version of the OpenAPI document: 0.53.0-beta +Contact: tech@getlago.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.4.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module LagoAPI + class FeeObjectAmountDetails + # Graduated ranges, used for a `graduated` charge model. + attr_accessor :graduated_ranges + + # Graduated percentage ranges, used for a `graduated_percentage` charge model. + attr_accessor :graduated_percentage_ranges + + # The quantity of units that are provided free of charge for each billing period in a `package` charge model. + attr_accessor :free_units + + # The quantity of units that are not provided free of charge for each billing period in a `package` charge model. + attr_accessor :paid_units + + # The quantity of units included, defined for Package or Percentage charge model. + attr_accessor :per_package_size + + # Total amount to charge for received paid_units, defined for Package or Percentage charge model. + attr_accessor :per_package_unit_amount + + # The total units received in Lago for the Percentage charge model. + attr_accessor :units + + # Total number of free events allowed for the Percentage charge model. + attr_accessor :free_events + + # Percentage rate applied for the Percentage charge model. + attr_accessor :rate + + # Total amount of received units to be charged for the Percentage charge model. + attr_accessor :per_unit_total_amount + + # Total number of paid events for the Percentage charge model. + attr_accessor :paid_events + + # Fixed fee unit price per received paid_event for the Percentage charge model. + attr_accessor :fixed_fee_unit_amount + + # Total amount to charge for received paid_events for the Percentage charge model. + attr_accessor :fixed_fee_total_amount + + # Total adjustment amount linked to minimum and maximum spending per transaction for the Percentage charge model. + attr_accessor :min_max_adjustment_total_amount + + # Volume ranges, used for a `volume` charge model. + attr_accessor :volume_ranges + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'graduated_ranges' => :'graduated_ranges', + :'graduated_percentage_ranges' => :'graduated_percentage_ranges', + :'free_units' => :'free_units', + :'paid_units' => :'paid_units', + :'per_package_size' => :'per_package_size', + :'per_package_unit_amount' => :'per_package_unit_amount', + :'units' => :'units', + :'free_events' => :'free_events', + :'rate' => :'rate', + :'per_unit_total_amount' => :'per_unit_total_amount', + :'paid_events' => :'paid_events', + :'fixed_fee_unit_amount' => :'fixed_fee_unit_amount', + :'fixed_fee_total_amount' => :'fixed_fee_total_amount', + :'min_max_adjustment_total_amount' => :'min_max_adjustment_total_amount', + :'volume_ranges' => :'volume_ranges' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'graduated_ranges' => :'Array', + :'graduated_percentage_ranges' => :'Array', + :'free_units' => :'String', + :'paid_units' => :'String', + :'per_package_size' => :'Integer', + :'per_package_unit_amount' => :'String', + :'units' => :'String', + :'free_events' => :'Integer', + :'rate' => :'String', + :'per_unit_total_amount' => :'String', + :'paid_events' => :'Integer', + :'fixed_fee_unit_amount' => :'String', + :'fixed_fee_total_amount' => :'String', + :'min_max_adjustment_total_amount' => :'String', + :'volume_ranges' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `LagoAPI::FeeObjectAmountDetails` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `LagoAPI::FeeObjectAmountDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'graduated_ranges') + if (value = attributes[:'graduated_ranges']).is_a?(Array) + self.graduated_ranges = value + end + end + + if attributes.key?(:'graduated_percentage_ranges') + if (value = attributes[:'graduated_percentage_ranges']).is_a?(Array) + self.graduated_percentage_ranges = value + end + end + + if attributes.key?(:'free_units') + self.free_units = attributes[:'free_units'] + end + + if attributes.key?(:'paid_units') + self.paid_units = attributes[:'paid_units'] + end + + if attributes.key?(:'per_package_size') + self.per_package_size = attributes[:'per_package_size'] + end + + if attributes.key?(:'per_package_unit_amount') + self.per_package_unit_amount = attributes[:'per_package_unit_amount'] + end + + if attributes.key?(:'units') + self.units = attributes[:'units'] + end + + if attributes.key?(:'free_events') + self.free_events = attributes[:'free_events'] + end + + if attributes.key?(:'rate') + self.rate = attributes[:'rate'] + end + + if attributes.key?(:'per_unit_total_amount') + self.per_unit_total_amount = attributes[:'per_unit_total_amount'] + end + + if attributes.key?(:'paid_events') + self.paid_events = attributes[:'paid_events'] + end + + if attributes.key?(:'fixed_fee_unit_amount') + self.fixed_fee_unit_amount = attributes[:'fixed_fee_unit_amount'] + end + + if attributes.key?(:'fixed_fee_total_amount') + self.fixed_fee_total_amount = attributes[:'fixed_fee_total_amount'] + end + + if attributes.key?(:'min_max_adjustment_total_amount') + self.min_max_adjustment_total_amount = attributes[:'min_max_adjustment_total_amount'] + end + + if attributes.key?(:'volume_ranges') + if (value = attributes[:'volume_ranges']).is_a?(Array) + self.volume_ranges = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if !@free_units.nil? && @free_units !~ pattern + invalid_properties.push("invalid value for \"free_units\", must conform to the pattern #{pattern}.") + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if !@paid_units.nil? && @paid_units !~ pattern + invalid_properties.push("invalid value for \"paid_units\", must conform to the pattern #{pattern}.") + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if !@per_package_unit_amount.nil? && @per_package_unit_amount !~ pattern + invalid_properties.push("invalid value for \"per_package_unit_amount\", must conform to the pattern #{pattern}.") + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if !@units.nil? && @units !~ pattern + invalid_properties.push("invalid value for \"units\", must conform to the pattern #{pattern}.") + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if !@free_units.nil? && @free_units !~ Regexp.new(/^[0-9]+.?[0-9]*$/) + return false if !@paid_units.nil? && @paid_units !~ Regexp.new(/^[0-9]+.?[0-9]*$/) + return false if !@per_package_unit_amount.nil? && @per_package_unit_amount !~ Regexp.new(/^[0-9]+.?[0-9]*$/) + return false if !@units.nil? && @units !~ Regexp.new(/^[0-9]+.?[0-9]*$/) + true + end + + # Custom attribute writer method with validation + # @param [Object] free_units Value to be assigned + def free_units=(free_units) + if free_units.nil? + fail ArgumentError, 'free_units cannot be nil' + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if free_units !~ pattern + fail ArgumentError, "invalid value for \"free_units\", must conform to the pattern #{pattern}." + end + + @free_units = free_units + end + + # Custom attribute writer method with validation + # @param [Object] paid_units Value to be assigned + def paid_units=(paid_units) + if paid_units.nil? + fail ArgumentError, 'paid_units cannot be nil' + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if paid_units !~ pattern + fail ArgumentError, "invalid value for \"paid_units\", must conform to the pattern #{pattern}." + end + + @paid_units = paid_units + end + + # Custom attribute writer method with validation + # @param [Object] per_package_unit_amount Value to be assigned + def per_package_unit_amount=(per_package_unit_amount) + if per_package_unit_amount.nil? + fail ArgumentError, 'per_package_unit_amount cannot be nil' + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if per_package_unit_amount !~ pattern + fail ArgumentError, "invalid value for \"per_package_unit_amount\", must conform to the pattern #{pattern}." + end + + @per_package_unit_amount = per_package_unit_amount + end + + # Custom attribute writer method with validation + # @param [Object] units Value to be assigned + def units=(units) + if units.nil? + fail ArgumentError, 'units cannot be nil' + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if units !~ pattern + fail ArgumentError, "invalid value for \"units\", must conform to the pattern #{pattern}." + end + + @units = units + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + graduated_ranges == o.graduated_ranges && + graduated_percentage_ranges == o.graduated_percentage_ranges && + free_units == o.free_units && + paid_units == o.paid_units && + per_package_size == o.per_package_size && + per_package_unit_amount == o.per_package_unit_amount && + units == o.units && + free_events == o.free_events && + rate == o.rate && + per_unit_total_amount == o.per_unit_total_amount && + paid_events == o.paid_events && + fixed_fee_unit_amount == o.fixed_fee_unit_amount && + fixed_fee_total_amount == o.fixed_fee_total_amount && + min_max_adjustment_total_amount == o.min_max_adjustment_total_amount && + volume_ranges == o.volume_ranges + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [graduated_ranges, graduated_percentage_ranges, free_units, paid_units, per_package_size, per_package_unit_amount, units, free_events, rate, per_unit_total_amount, paid_events, fixed_fee_unit_amount, fixed_fee_total_amount, min_max_adjustment_total_amount, volume_ranges].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = LagoAPI.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby/lib/lago_ruby/models/fee_object_amount_details_all_of_graduated_percentage_ranges_inner.rb b/ruby/lib/lago_ruby/models/fee_object_amount_details_all_of_graduated_percentage_ranges_inner.rb new file mode 100644 index 0000000..5a4b9c5 --- /dev/null +++ b/ruby/lib/lago_ruby/models/fee_object_amount_details_all_of_graduated_percentage_ranges_inner.rb @@ -0,0 +1,341 @@ +=begin +#Lago API documentation + +#Lago API allows your application to push customer information and metrics (events) from your application to the billing application. + +The version of the OpenAPI document: 0.53.0-beta +Contact: tech@getlago.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.4.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module LagoAPI + class FeeObjectAmountDetailsAllOfGraduatedPercentageRangesInner + # Total units received in Lago. + attr_accessor :units + + # Lower value of a tier. It is either 0 or the previous range's `to_value + 1`. + attr_accessor :from_value + + # Highest value of a tier. - This value is higher than the from_value of the same tier. - This value is null for the last tier. + attr_accessor :to_value + + # Flat unit amount within a specified tier. + attr_accessor :flat_unit_amount + + # Percentage rate applied within a specified tier. + attr_accessor :rate + + # Total amount of received units to be charged within a specified tier. + attr_accessor :per_unit_total_amount + + # Total amount to be charged for a specific tier, taking into account the flat_unit_amount and the per_unit_total_amount. + attr_accessor :total_with_flat_amount + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'units' => :'units', + :'from_value' => :'from_value', + :'to_value' => :'to_value', + :'flat_unit_amount' => :'flat_unit_amount', + :'rate' => :'rate', + :'per_unit_total_amount' => :'per_unit_total_amount', + :'total_with_flat_amount' => :'total_with_flat_amount' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'units' => :'String', + :'from_value' => :'Integer', + :'to_value' => :'Integer', + :'flat_unit_amount' => :'String', + :'rate' => :'String', + :'per_unit_total_amount' => :'String', + :'total_with_flat_amount' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'to_value', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `LagoAPI::FeeObjectAmountDetailsAllOfGraduatedPercentageRangesInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `LagoAPI::FeeObjectAmountDetailsAllOfGraduatedPercentageRangesInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'units') + self.units = attributes[:'units'] + else + self.units = nil + end + + if attributes.key?(:'from_value') + self.from_value = attributes[:'from_value'] + else + self.from_value = nil + end + + if attributes.key?(:'to_value') + self.to_value = attributes[:'to_value'] + else + self.to_value = nil + end + + if attributes.key?(:'flat_unit_amount') + self.flat_unit_amount = attributes[:'flat_unit_amount'] + else + self.flat_unit_amount = nil + end + + if attributes.key?(:'rate') + self.rate = attributes[:'rate'] + else + self.rate = nil + end + + if attributes.key?(:'per_unit_total_amount') + self.per_unit_total_amount = attributes[:'per_unit_total_amount'] + else + self.per_unit_total_amount = nil + end + + if attributes.key?(:'total_with_flat_amount') + self.total_with_flat_amount = attributes[:'total_with_flat_amount'] + else + self.total_with_flat_amount = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @units.nil? + invalid_properties.push('invalid value for "units", units cannot be nil.') + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if @units !~ pattern + invalid_properties.push("invalid value for \"units\", must conform to the pattern #{pattern}.") + end + + if @from_value.nil? + invalid_properties.push('invalid value for "from_value", from_value cannot be nil.') + end + + if @flat_unit_amount.nil? + invalid_properties.push('invalid value for "flat_unit_amount", flat_unit_amount cannot be nil.') + end + + if @rate.nil? + invalid_properties.push('invalid value for "rate", rate cannot be nil.') + end + + if @per_unit_total_amount.nil? + invalid_properties.push('invalid value for "per_unit_total_amount", per_unit_total_amount cannot be nil.') + end + + if @total_with_flat_amount.nil? + invalid_properties.push('invalid value for "total_with_flat_amount", total_with_flat_amount cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @units.nil? + return false if @units !~ Regexp.new(/^[0-9]+.?[0-9]*$/) + return false if @from_value.nil? + return false if @flat_unit_amount.nil? + return false if @rate.nil? + return false if @per_unit_total_amount.nil? + return false if @total_with_flat_amount.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] units Value to be assigned + def units=(units) + if units.nil? + fail ArgumentError, 'units cannot be nil' + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if units !~ pattern + fail ArgumentError, "invalid value for \"units\", must conform to the pattern #{pattern}." + end + + @units = units + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + units == o.units && + from_value == o.from_value && + to_value == o.to_value && + flat_unit_amount == o.flat_unit_amount && + rate == o.rate && + per_unit_total_amount == o.per_unit_total_amount && + total_with_flat_amount == o.total_with_flat_amount + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [units, from_value, to_value, flat_unit_amount, rate, per_unit_total_amount, total_with_flat_amount].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = LagoAPI.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby/lib/lago_ruby/models/fee_object_amount_details_all_of_graduated_ranges_inner.rb b/ruby/lib/lago_ruby/models/fee_object_amount_details_all_of_graduated_ranges_inner.rb new file mode 100644 index 0000000..191919f --- /dev/null +++ b/ruby/lib/lago_ruby/models/fee_object_amount_details_all_of_graduated_ranges_inner.rb @@ -0,0 +1,341 @@ +=begin +#Lago API documentation + +#Lago API allows your application to push customer information and metrics (events) from your application to the billing application. + +The version of the OpenAPI document: 0.53.0-beta +Contact: tech@getlago.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.4.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module LagoAPI + class FeeObjectAmountDetailsAllOfGraduatedRangesInner + # Total units received in Lago. + attr_accessor :units + + # Lower value of a tier. It is either 0 or the previous range's `to_value + 1`. + attr_accessor :from_value + + # Highest value of a tier. - This value is higher than the from_value of the same tier. - This value is null for the last tier. + attr_accessor :to_value + + # Flat unit amount within a specified tier. + attr_accessor :flat_unit_amount + + # Amount per unit within a specified tier. + attr_accessor :per_unit_amount + + # Total amount of received units to be charged within a specified tier. + attr_accessor :per_unit_total_amount + + # Total amount to be charged for a specific tier, taking into account the flat_unit_amount and the per_unit_total_amount. + attr_accessor :total_with_flat_amount + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'units' => :'units', + :'from_value' => :'from_value', + :'to_value' => :'to_value', + :'flat_unit_amount' => :'flat_unit_amount', + :'per_unit_amount' => :'per_unit_amount', + :'per_unit_total_amount' => :'per_unit_total_amount', + :'total_with_flat_amount' => :'total_with_flat_amount' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'units' => :'String', + :'from_value' => :'Integer', + :'to_value' => :'Integer', + :'flat_unit_amount' => :'String', + :'per_unit_amount' => :'String', + :'per_unit_total_amount' => :'String', + :'total_with_flat_amount' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'to_value', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `LagoAPI::FeeObjectAmountDetailsAllOfGraduatedRangesInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `LagoAPI::FeeObjectAmountDetailsAllOfGraduatedRangesInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'units') + self.units = attributes[:'units'] + else + self.units = nil + end + + if attributes.key?(:'from_value') + self.from_value = attributes[:'from_value'] + else + self.from_value = nil + end + + if attributes.key?(:'to_value') + self.to_value = attributes[:'to_value'] + else + self.to_value = nil + end + + if attributes.key?(:'flat_unit_amount') + self.flat_unit_amount = attributes[:'flat_unit_amount'] + else + self.flat_unit_amount = nil + end + + if attributes.key?(:'per_unit_amount') + self.per_unit_amount = attributes[:'per_unit_amount'] + else + self.per_unit_amount = nil + end + + if attributes.key?(:'per_unit_total_amount') + self.per_unit_total_amount = attributes[:'per_unit_total_amount'] + else + self.per_unit_total_amount = nil + end + + if attributes.key?(:'total_with_flat_amount') + self.total_with_flat_amount = attributes[:'total_with_flat_amount'] + else + self.total_with_flat_amount = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @units.nil? + invalid_properties.push('invalid value for "units", units cannot be nil.') + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if @units !~ pattern + invalid_properties.push("invalid value for \"units\", must conform to the pattern #{pattern}.") + end + + if @from_value.nil? + invalid_properties.push('invalid value for "from_value", from_value cannot be nil.') + end + + if @flat_unit_amount.nil? + invalid_properties.push('invalid value for "flat_unit_amount", flat_unit_amount cannot be nil.') + end + + if @per_unit_amount.nil? + invalid_properties.push('invalid value for "per_unit_amount", per_unit_amount cannot be nil.') + end + + if @per_unit_total_amount.nil? + invalid_properties.push('invalid value for "per_unit_total_amount", per_unit_total_amount cannot be nil.') + end + + if @total_with_flat_amount.nil? + invalid_properties.push('invalid value for "total_with_flat_amount", total_with_flat_amount cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @units.nil? + return false if @units !~ Regexp.new(/^[0-9]+.?[0-9]*$/) + return false if @from_value.nil? + return false if @flat_unit_amount.nil? + return false if @per_unit_amount.nil? + return false if @per_unit_total_amount.nil? + return false if @total_with_flat_amount.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] units Value to be assigned + def units=(units) + if units.nil? + fail ArgumentError, 'units cannot be nil' + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if units !~ pattern + fail ArgumentError, "invalid value for \"units\", must conform to the pattern #{pattern}." + end + + @units = units + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + units == o.units && + from_value == o.from_value && + to_value == o.to_value && + flat_unit_amount == o.flat_unit_amount && + per_unit_amount == o.per_unit_amount && + per_unit_total_amount == o.per_unit_total_amount && + total_with_flat_amount == o.total_with_flat_amount + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [units, from_value, to_value, flat_unit_amount, per_unit_amount, per_unit_total_amount, total_with_flat_amount].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = LagoAPI.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby/lib/lago_ruby/models/fee_object_amount_details_all_of_volume_ranges_inner.rb b/ruby/lib/lago_ruby/models/fee_object_amount_details_all_of_volume_ranges_inner.rb new file mode 100644 index 0000000..583b8d0 --- /dev/null +++ b/ruby/lib/lago_ruby/models/fee_object_amount_details_all_of_volume_ranges_inner.rb @@ -0,0 +1,319 @@ +=begin +#Lago API documentation + +#Lago API allows your application to push customer information and metrics (events) from your application to the billing application. + +The version of the OpenAPI document: 0.53.0-beta +Contact: tech@getlago.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.4.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module LagoAPI + class FeeObjectAmountDetailsAllOfVolumeRangesInner + # The flat amount for a whole tier, excluding tax, for a `volume` charge model. + attr_accessor :per_unit_amount + + # The unit price, excluding tax, for a specific tier of a `volume` charge model. + attr_accessor :flat_unit_amount + + # Total amount of received units to be charged. + attr_accessor :per_unit_total_amount + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'per_unit_amount' => :'per_unit_amount', + :'flat_unit_amount' => :'flat_unit_amount', + :'per_unit_total_amount' => :'per_unit_total_amount' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'per_unit_amount' => :'String', + :'flat_unit_amount' => :'String', + :'per_unit_total_amount' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `LagoAPI::FeeObjectAmountDetailsAllOfVolumeRangesInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `LagoAPI::FeeObjectAmountDetailsAllOfVolumeRangesInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'per_unit_amount') + self.per_unit_amount = attributes[:'per_unit_amount'] + else + self.per_unit_amount = nil + end + + if attributes.key?(:'flat_unit_amount') + self.flat_unit_amount = attributes[:'flat_unit_amount'] + else + self.flat_unit_amount = nil + end + + if attributes.key?(:'per_unit_total_amount') + self.per_unit_total_amount = attributes[:'per_unit_total_amount'] + else + self.per_unit_total_amount = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @per_unit_amount.nil? + invalid_properties.push('invalid value for "per_unit_amount", per_unit_amount cannot be nil.') + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if @per_unit_amount !~ pattern + invalid_properties.push("invalid value for \"per_unit_amount\", must conform to the pattern #{pattern}.") + end + + if @flat_unit_amount.nil? + invalid_properties.push('invalid value for "flat_unit_amount", flat_unit_amount cannot be nil.') + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if @flat_unit_amount !~ pattern + invalid_properties.push("invalid value for \"flat_unit_amount\", must conform to the pattern #{pattern}.") + end + + if @per_unit_total_amount.nil? + invalid_properties.push('invalid value for "per_unit_total_amount", per_unit_total_amount cannot be nil.') + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if @per_unit_total_amount !~ pattern + invalid_properties.push("invalid value for \"per_unit_total_amount\", must conform to the pattern #{pattern}.") + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @per_unit_amount.nil? + return false if @per_unit_amount !~ Regexp.new(/^[0-9]+.?[0-9]*$/) + return false if @flat_unit_amount.nil? + return false if @flat_unit_amount !~ Regexp.new(/^[0-9]+.?[0-9]*$/) + return false if @per_unit_total_amount.nil? + return false if @per_unit_total_amount !~ Regexp.new(/^[0-9]+.?[0-9]*$/) + true + end + + # Custom attribute writer method with validation + # @param [Object] per_unit_amount Value to be assigned + def per_unit_amount=(per_unit_amount) + if per_unit_amount.nil? + fail ArgumentError, 'per_unit_amount cannot be nil' + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if per_unit_amount !~ pattern + fail ArgumentError, "invalid value for \"per_unit_amount\", must conform to the pattern #{pattern}." + end + + @per_unit_amount = per_unit_amount + end + + # Custom attribute writer method with validation + # @param [Object] flat_unit_amount Value to be assigned + def flat_unit_amount=(flat_unit_amount) + if flat_unit_amount.nil? + fail ArgumentError, 'flat_unit_amount cannot be nil' + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if flat_unit_amount !~ pattern + fail ArgumentError, "invalid value for \"flat_unit_amount\", must conform to the pattern #{pattern}." + end + + @flat_unit_amount = flat_unit_amount + end + + # Custom attribute writer method with validation + # @param [Object] per_unit_total_amount Value to be assigned + def per_unit_total_amount=(per_unit_total_amount) + if per_unit_total_amount.nil? + fail ArgumentError, 'per_unit_total_amount cannot be nil' + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if per_unit_total_amount !~ pattern + fail ArgumentError, "invalid value for \"per_unit_total_amount\", must conform to the pattern #{pattern}." + end + + @per_unit_total_amount = per_unit_total_amount + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + per_unit_amount == o.per_unit_amount && + flat_unit_amount == o.flat_unit_amount && + per_unit_total_amount == o.per_unit_total_amount + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [per_unit_amount, flat_unit_amount, per_unit_total_amount].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = LagoAPI.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby/lib/lago_ruby/models/fee_object_item.rb b/ruby/lib/lago_ruby/models/fee_object_item.rb index 6954747..babc35e 100644 --- a/ruby/lib/lago_ruby/models/fee_object_item.rb +++ b/ruby/lib/lago_ruby/models/fee_object_item.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -37,6 +37,9 @@ class FeeObjectItem # The type of the fee item. Possible values are `AddOn`, `BillableMetric`, `WalletTransaction` or `Subscription`. attr_accessor :item_type + # Key value list of event properties aggregated by the charge model + attr_accessor :grouped_by + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -68,7 +71,8 @@ def self.attribute_map :'invoice_display_name' => :'invoice_display_name', :'group_invoice_display_name' => :'group_invoice_display_name', :'lago_item_id' => :'lago_item_id', - :'item_type' => :'item_type' + :'item_type' => :'item_type', + :'grouped_by' => :'grouped_by' } end @@ -86,7 +90,8 @@ def self.openapi_types :'invoice_display_name' => :'String', :'group_invoice_display_name' => :'String', :'lago_item_id' => :'String', - :'item_type' => :'String' + :'item_type' => :'String', + :'grouped_by' => :'Hash' } end @@ -148,6 +153,12 @@ def initialize(attributes = {}) else self.item_type = nil end + + if attributes.key?(:'grouped_by') + if (value = attributes[:'grouped_by']).is_a?(Hash) + self.grouped_by = value + end + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -225,7 +236,8 @@ def ==(o) invoice_display_name == o.invoice_display_name && group_invoice_display_name == o.group_invoice_display_name && lago_item_id == o.lago_item_id && - item_type == o.item_type + item_type == o.item_type && + grouped_by == o.grouped_by end # @see the `==` method @@ -237,7 +249,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [type, code, name, invoice_display_name, group_invoice_display_name, lago_item_id, item_type].hash + [type, code, name, invoice_display_name, group_invoice_display_name, lago_item_id, item_type, grouped_by].hash end # Builds the object from hash diff --git a/ruby/lib/lago_ruby/models/fee_update_input.rb b/ruby/lib/lago_ruby/models/fee_update_input.rb index 35874f4..e77f8d2 100644 --- a/ruby/lib/lago_ruby/models/fee_update_input.rb +++ b/ruby/lib/lago_ruby/models/fee_update_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/fee_update_input_fee.rb b/ruby/lib/lago_ruby/models/fee_update_input_fee.rb index 226aa1b..3ef6fb6 100644 --- a/ruby/lib/lago_ruby/models/fee_update_input_fee.rb +++ b/ruby/lib/lago_ruby/models/fee_update_input_fee.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/fees.rb b/ruby/lib/lago_ruby/models/fees.rb index d928768..b9832d3 100644 --- a/ruby/lib/lago_ruby/models/fees.rb +++ b/ruby/lib/lago_ruby/models/fees.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/fees_paginated.rb b/ruby/lib/lago_ruby/models/fees_paginated.rb index 7a63859..12c74d6 100644 --- a/ruby/lib/lago_ruby/models/fees_paginated.rb +++ b/ruby/lib/lago_ruby/models/fees_paginated.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/generate_customer_checkout_url200_response.rb b/ruby/lib/lago_ruby/models/generate_customer_checkout_url200_response.rb index 1d846d6..4c99912 100644 --- a/ruby/lib/lago_ruby/models/generate_customer_checkout_url200_response.rb +++ b/ruby/lib/lago_ruby/models/generate_customer_checkout_url200_response.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -16,25 +16,12 @@ module LagoAPI # . class GenerateCustomerCheckoutURL200Response - # Unique identifier assigned to the customer within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the customer's record within the Lago system - attr_accessor :lago_customer_id - - # The customer external unique identifier (provided by your own application) - attr_accessor :external_customer_id - - # The Payment Provider name linked to the Customer. - attr_accessor :payment_provider - - # The new generated Payment Provider Checkout URL for the Customer. - attr_accessor :checkout_url + attr_accessor :customer # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'lago_customer_id' => :'lago_customer_id', - :'external_customer_id' => :'external_customer_id', - :'payment_provider' => :'payment_provider', - :'checkout_url' => :'checkout_url' + :'customer' => :'customer' } end @@ -46,10 +33,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'lago_customer_id' => :'String', - :'external_customer_id' => :'String', - :'payment_provider' => :'String', - :'checkout_url' => :'String' + :'customer' => :'GenerateCustomerCheckoutURL200ResponseCustomer' } end @@ -74,20 +58,8 @@ def initialize(attributes = {}) h[k.to_sym] = v } - if attributes.key?(:'lago_customer_id') - self.lago_customer_id = attributes[:'lago_customer_id'] - end - - if attributes.key?(:'external_customer_id') - self.external_customer_id = attributes[:'external_customer_id'] - end - - if attributes.key?(:'payment_provider') - self.payment_provider = attributes[:'payment_provider'] - end - - if attributes.key?(:'checkout_url') - self.checkout_url = attributes[:'checkout_url'] + if attributes.key?(:'customer') + self.customer = attributes[:'customer'] end end @@ -111,10 +83,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - lago_customer_id == o.lago_customer_id && - external_customer_id == o.external_customer_id && - payment_provider == o.payment_provider && - checkout_url == o.checkout_url + customer == o.customer end # @see the `==` method @@ -126,7 +95,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [lago_customer_id, external_customer_id, payment_provider, checkout_url].hash + [customer].hash end # Builds the object from hash diff --git a/ruby/lib/lago_ruby/models/generate_customer_checkout_url200_response_customer.rb b/ruby/lib/lago_ruby/models/generate_customer_checkout_url200_response_customer.rb new file mode 100644 index 0000000..86d870d --- /dev/null +++ b/ruby/lib/lago_ruby/models/generate_customer_checkout_url200_response_customer.rb @@ -0,0 +1,245 @@ +=begin +#Lago API documentation + +#Lago API allows your application to push customer information and metrics (events) from your application to the billing application. + +The version of the OpenAPI document: 0.53.0-beta +Contact: tech@getlago.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.4.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module LagoAPI + class GenerateCustomerCheckoutURL200ResponseCustomer + # Unique identifier assigned to the customer within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the customer's record within the Lago system + attr_accessor :lago_customer_id + + # The customer external unique identifier (provided by your own application) + attr_accessor :external_customer_id + + # The Payment Provider name linked to the Customer. + attr_accessor :payment_provider + + # The new generated Payment Provider Checkout URL for the Customer. + attr_accessor :checkout_url + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'lago_customer_id' => :'lago_customer_id', + :'external_customer_id' => :'external_customer_id', + :'payment_provider' => :'payment_provider', + :'checkout_url' => :'checkout_url' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'lago_customer_id' => :'String', + :'external_customer_id' => :'String', + :'payment_provider' => :'String', + :'checkout_url' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `LagoAPI::GenerateCustomerCheckoutURL200ResponseCustomer` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `LagoAPI::GenerateCustomerCheckoutURL200ResponseCustomer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'lago_customer_id') + self.lago_customer_id = attributes[:'lago_customer_id'] + end + + if attributes.key?(:'external_customer_id') + self.external_customer_id = attributes[:'external_customer_id'] + end + + if attributes.key?(:'payment_provider') + self.payment_provider = attributes[:'payment_provider'] + end + + if attributes.key?(:'checkout_url') + self.checkout_url = attributes[:'checkout_url'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + lago_customer_id == o.lago_customer_id && + external_customer_id == o.external_customer_id && + payment_provider == o.payment_provider && + checkout_url == o.checkout_url + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [lago_customer_id, external_customer_id, payment_provider, checkout_url].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = LagoAPI.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby/lib/lago_ruby/models/get_customer_portal_url200_response.rb b/ruby/lib/lago_ruby/models/get_customer_portal_url200_response.rb index 51a403c..ac9b3f4 100644 --- a/ruby/lib/lago_ruby/models/get_customer_portal_url200_response.rb +++ b/ruby/lib/lago_ruby/models/get_customer_portal_url200_response.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/get_customer_portal_url200_response_customer.rb b/ruby/lib/lago_ruby/models/get_customer_portal_url200_response_customer.rb index c127534..293bc8a 100644 --- a/ruby/lib/lago_ruby/models/get_customer_portal_url200_response_customer.rb +++ b/ruby/lib/lago_ruby/models/get_customer_portal_url200_response_customer.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/gross_revenue_object.rb b/ruby/lib/lago_ruby/models/gross_revenue_object.rb index aabfbf1..2926c38 100644 --- a/ruby/lib/lago_ruby/models/gross_revenue_object.rb +++ b/ruby/lib/lago_ruby/models/gross_revenue_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/gross_revenues.rb b/ruby/lib/lago_ruby/models/gross_revenues.rb index 3fab4d8..f77c4f8 100644 --- a/ruby/lib/lago_ruby/models/gross_revenues.rb +++ b/ruby/lib/lago_ruby/models/gross_revenues.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/group_object.rb b/ruby/lib/lago_ruby/models/group_object.rb index cb99ec1..5c7b914 100644 --- a/ruby/lib/lago_ruby/models/group_object.rb +++ b/ruby/lib/lago_ruby/models/group_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/group_properties_object.rb b/ruby/lib/lago_ruby/models/group_properties_object.rb index ff53d7d..ab81900 100644 --- a/ruby/lib/lago_ruby/models/group_properties_object.rb +++ b/ruby/lib/lago_ruby/models/group_properties_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/group_properties_object_values.rb b/ruby/lib/lago_ruby/models/group_properties_object_values.rb index bd0e41e..2351f61 100644 --- a/ruby/lib/lago_ruby/models/group_properties_object_values.rb +++ b/ruby/lib/lago_ruby/models/group_properties_object_values.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -48,6 +48,9 @@ class GroupPropertiesObjectValues # Specifies the minimum allowable spending for a single transaction. Working as a transaction floor. attr_accessor :per_transaction_min_amount + # The list of event properties that are used to group the events on the invoice for a `standard` charge model. + attr_accessor :grouped_by + # Volume ranges, sorted from bottom to top tiers, used for a `volume` charge model. attr_accessor :volume_ranges @@ -65,6 +68,7 @@ def self.attribute_map :'free_units_per_total_aggregation' => :'free_units_per_total_aggregation', :'per_transaction_max_amount' => :'per_transaction_max_amount', :'per_transaction_min_amount' => :'per_transaction_min_amount', + :'grouped_by' => :'grouped_by', :'volume_ranges' => :'volume_ranges' } end @@ -88,6 +92,7 @@ def self.openapi_types :'free_units_per_total_aggregation' => :'String', :'per_transaction_max_amount' => :'String', :'per_transaction_min_amount' => :'String', + :'grouped_by' => :'Array', :'volume_ranges' => :'Array' } end @@ -172,6 +177,12 @@ def initialize(attributes = {}) self.per_transaction_min_amount = attributes[:'per_transaction_min_amount'] end + if attributes.key?(:'grouped_by') + if (value = attributes[:'grouped_by']).is_a?(Array) + self.grouped_by = value + end + end + if attributes.key?(:'volume_ranges') if (value = attributes[:'volume_ranges']).is_a?(Array) self.volume_ranges = value @@ -290,6 +301,7 @@ def ==(o) free_units_per_total_aggregation == o.free_units_per_total_aggregation && per_transaction_max_amount == o.per_transaction_max_amount && per_transaction_min_amount == o.per_transaction_min_amount && + grouped_by == o.grouped_by && volume_ranges == o.volume_ranges end @@ -302,7 +314,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [graduated_ranges, graduated_percentage_ranges, amount, free_units, package_size, rate, fixed_amount, free_units_per_events, free_units_per_total_aggregation, per_transaction_max_amount, per_transaction_min_amount, volume_ranges].hash + [graduated_ranges, graduated_percentage_ranges, amount, free_units, package_size, rate, fixed_amount, free_units_per_events, free_units_per_total_aggregation, per_transaction_max_amount, per_transaction_min_amount, grouped_by, volume_ranges].hash end # Builds the object from hash diff --git a/ruby/lib/lago_ruby/models/groups_paginated.rb b/ruby/lib/lago_ruby/models/groups_paginated.rb index 2214ab8..21b8be0 100644 --- a/ruby/lib/lago_ruby/models/groups_paginated.rb +++ b/ruby/lib/lago_ruby/models/groups_paginated.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/invoice.rb b/ruby/lib/lago_ruby/models/invoice.rb index 3df50d1..09d0dd9 100644 --- a/ruby/lib/lago_ruby/models/invoice.rb +++ b/ruby/lib/lago_ruby/models/invoice.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/invoice_applied_tax_object.rb b/ruby/lib/lago_ruby/models/invoice_applied_tax_object.rb index ee819c0..5b6f68c 100644 --- a/ruby/lib/lago_ruby/models/invoice_applied_tax_object.rb +++ b/ruby/lib/lago_ruby/models/invoice_applied_tax_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/invoice_collection_object.rb b/ruby/lib/lago_ruby/models/invoice_collection_object.rb new file mode 100644 index 0000000..763844a --- /dev/null +++ b/ruby/lib/lago_ruby/models/invoice_collection_object.rb @@ -0,0 +1,309 @@ +=begin +#Lago API documentation + +#Lago API allows your application to push customer information and metrics (events) from your application to the billing application. + +The version of the OpenAPI document: 0.53.0-beta +Contact: tech@getlago.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.4.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module LagoAPI + class InvoiceCollectionObject + # Identifies the month to analyze revenue. + attr_accessor :month + + # The payment status of the invoices. + attr_accessor :payment_status + + # Contains invoices count. + attr_accessor :invoices_count + + # The total amount of revenue for a period, expressed in cents. + attr_accessor :amount_cents + + attr_accessor :currency + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'month' => :'month', + :'payment_status' => :'payment_status', + :'invoices_count' => :'invoices_count', + :'amount_cents' => :'amount_cents', + :'currency' => :'currency' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'month' => :'String', + :'payment_status' => :'String', + :'invoices_count' => :'Integer', + :'amount_cents' => :'Integer', + :'currency' => :'Currency' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `LagoAPI::InvoiceCollectionObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `LagoAPI::InvoiceCollectionObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'month') + self.month = attributes[:'month'] + else + self.month = nil + end + + if attributes.key?(:'payment_status') + self.payment_status = attributes[:'payment_status'] + end + + if attributes.key?(:'invoices_count') + self.invoices_count = attributes[:'invoices_count'] + else + self.invoices_count = nil + end + + if attributes.key?(:'amount_cents') + self.amount_cents = attributes[:'amount_cents'] + else + self.amount_cents = nil + end + + if attributes.key?(:'currency') + self.currency = attributes[:'currency'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @month.nil? + invalid_properties.push('invalid value for "month", month cannot be nil.') + end + + if @invoices_count.nil? + invalid_properties.push('invalid value for "invoices_count", invoices_count cannot be nil.') + end + + if @amount_cents.nil? + invalid_properties.push('invalid value for "amount_cents", amount_cents cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @month.nil? + payment_status_validator = EnumAttributeValidator.new('String', ["pending", "succeeded", "failed"]) + return false unless payment_status_validator.valid?(@payment_status) + return false if @invoices_count.nil? + return false if @amount_cents.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] payment_status Object to be assigned + def payment_status=(payment_status) + validator = EnumAttributeValidator.new('String', ["pending", "succeeded", "failed"]) + unless validator.valid?(payment_status) + fail ArgumentError, "invalid value for \"payment_status\", must be one of #{validator.allowable_values}." + end + @payment_status = payment_status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + month == o.month && + payment_status == o.payment_status && + invoices_count == o.invoices_count && + amount_cents == o.amount_cents && + currency == o.currency + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [month, payment_status, invoices_count, amount_cents, currency].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = LagoAPI.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby/lib/lago_ruby/models/invoice_collections.rb b/ruby/lib/lago_ruby/models/invoice_collections.rb new file mode 100644 index 0000000..9b54892 --- /dev/null +++ b/ruby/lib/lago_ruby/models/invoice_collections.rb @@ -0,0 +1,223 @@ +=begin +#Lago API documentation + +#Lago API allows your application to push customer information and metrics (events) from your application to the billing application. + +The version of the OpenAPI document: 0.53.0-beta +Contact: tech@getlago.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.4.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module LagoAPI + class InvoiceCollections + attr_accessor :invoice_collections + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'invoice_collections' => :'invoice_collections' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'invoice_collections' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `LagoAPI::InvoiceCollections` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `LagoAPI::InvoiceCollections`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'invoice_collections') + if (value = attributes[:'invoice_collections']).is_a?(Array) + self.invoice_collections = value + end + else + self.invoice_collections = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @invoice_collections.nil? + invalid_properties.push('invalid value for "invoice_collections", invoice_collections cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @invoice_collections.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + invoice_collections == o.invoice_collections + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [invoice_collections].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = LagoAPI.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby/lib/lago_ruby/models/invoice_metadata_object.rb b/ruby/lib/lago_ruby/models/invoice_metadata_object.rb index f7ae2ad..e8cba3a 100644 --- a/ruby/lib/lago_ruby/models/invoice_metadata_object.rb +++ b/ruby/lib/lago_ruby/models/invoice_metadata_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/invoice_object.rb b/ruby/lib/lago_ruby/models/invoice_object.rb index 802d6ce..79ca939 100644 --- a/ruby/lib/lago_ruby/models/invoice_object.rb +++ b/ruby/lib/lago_ruby/models/invoice_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -36,7 +36,7 @@ class InvoiceObject # The type of invoice issued. Possible values are `subscription`, `one-off` or `credit`. attr_accessor :invoice_type - # The status of the invoice. It indicates the current state of the invoice and can have two possible values: - `draft`: the invoice is in the draft state, waiting for the end of the grace period to be finalized. During this period, events can still be ingested and added to the invoice. - `finalized`: the invoice has been issued and finalized. In this state, events cannot be ingested or added to the invoice anymore. + # The status of the invoice. It indicates the current state of the invoice and can have two possible values: - `draft`: the invoice is in the draft state, waiting for the end of the grace period to be finalized. During this period, events can still be ingested and added to the invoice. - `finalized`: the invoice has been issued and finalized. In this state, events cannot be ingested or added to the invoice anymore. - `voided`: the invoice has been issued and subsequently voided. In this state, events cannot be ingested or added to the invoice anymore. attr_accessor :status # The status of the payment associated with the invoice. It can have one of the following values: - `pending`: the payment is pending, waiting for payment processing in Stripe or when the invoice is emitted but users have not updated the payment status through the endpoint. - `succeeded`: the payment of the invoice has been successfully processed. - `failed`: the payment of the invoice has failed or encountered an error during processing. @@ -404,7 +404,7 @@ def valid? invoice_type_validator = EnumAttributeValidator.new('String', ["subscription", "add_on", "credit", "one_off"]) return false unless invoice_type_validator.valid?(@invoice_type) return false if @status.nil? - status_validator = EnumAttributeValidator.new('String', ["draft", "finalized"]) + status_validator = EnumAttributeValidator.new('String', ["draft", "finalized", "voided"]) return false unless status_validator.valid?(@status) return false if @payment_status.nil? payment_status_validator = EnumAttributeValidator.new('String', ["pending", "succeeded", "failed"]) @@ -435,7 +435,7 @@ def invoice_type=(invoice_type) # Custom attribute writer method checking allowed values (enum). # @param [Object] status Object to be assigned def status=(status) - validator = EnumAttributeValidator.new('String', ["draft", "finalized"]) + validator = EnumAttributeValidator.new('String', ["draft", "finalized", "voided"]) unless validator.valid?(status) fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." end diff --git a/ruby/lib/lago_ruby/models/invoice_object_customer.rb b/ruby/lib/lago_ruby/models/invoice_object_customer.rb index 72f151b..a63ed31 100644 --- a/ruby/lib/lago_ruby/models/invoice_object_customer.rb +++ b/ruby/lib/lago_ruby/models/invoice_object_customer.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/invoice_object_extended.rb b/ruby/lib/lago_ruby/models/invoice_object_extended.rb index 7c9fa6b..488238d 100644 --- a/ruby/lib/lago_ruby/models/invoice_object_extended.rb +++ b/ruby/lib/lago_ruby/models/invoice_object_extended.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -36,7 +36,7 @@ class InvoiceObjectExtended # The type of invoice issued. Possible values are `subscription`, `one-off` or `credit`. attr_accessor :invoice_type - # The status of the invoice. It indicates the current state of the invoice and can have two possible values: - `draft`: the invoice is in the draft state, waiting for the end of the grace period to be finalized. During this period, events can still be ingested and added to the invoice. - `finalized`: the invoice has been issued and finalized. In this state, events cannot be ingested or added to the invoice anymore. + # The status of the invoice. It indicates the current state of the invoice and can have two possible values: - `draft`: the invoice is in the draft state, waiting for the end of the grace period to be finalized. During this period, events can still be ingested and added to the invoice. - `finalized`: the invoice has been issued and finalized. In this state, events cannot be ingested or added to the invoice anymore. - `voided`: the invoice has been issued and subsequently voided. In this state, events cannot be ingested or added to the invoice anymore. attr_accessor :status # The status of the payment associated with the invoice. It can have one of the following values: - `pending`: the payment is pending, waiting for payment processing in Stripe or when the invoice is emitted but users have not updated the payment status through the endpoint. - `succeeded`: the payment of the invoice has been successfully processed. - `failed`: the payment of the invoice has failed or encountered an error during processing. @@ -441,7 +441,7 @@ def valid? invoice_type_validator = EnumAttributeValidator.new('String', ["subscription", "add_on", "credit", "one_off"]) return false unless invoice_type_validator.valid?(@invoice_type) return false if @status.nil? - status_validator = EnumAttributeValidator.new('String', ["draft", "finalized"]) + status_validator = EnumAttributeValidator.new('String', ["draft", "finalized", "voided"]) return false unless status_validator.valid?(@status) return false if @payment_status.nil? payment_status_validator = EnumAttributeValidator.new('String', ["pending", "succeeded", "failed"]) @@ -472,7 +472,7 @@ def invoice_type=(invoice_type) # Custom attribute writer method checking allowed values (enum). # @param [Object] status Object to be assigned def status=(status) - validator = EnumAttributeValidator.new('String', ["draft", "finalized"]) + validator = EnumAttributeValidator.new('String', ["draft", "finalized", "voided"]) unless validator.valid?(status) fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." end diff --git a/ruby/lib/lago_ruby/models/invoice_one_off_create_input.rb b/ruby/lib/lago_ruby/models/invoice_one_off_create_input.rb index 6f83aff..96d3c12 100644 --- a/ruby/lib/lago_ruby/models/invoice_one_off_create_input.rb +++ b/ruby/lib/lago_ruby/models/invoice_one_off_create_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/invoice_one_off_create_input_invoice.rb b/ruby/lib/lago_ruby/models/invoice_one_off_create_input_invoice.rb index 4d91eda..734a0e8 100644 --- a/ruby/lib/lago_ruby/models/invoice_one_off_create_input_invoice.rb +++ b/ruby/lib/lago_ruby/models/invoice_one_off_create_input_invoice.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/invoice_one_off_create_input_invoice_fees_inner.rb b/ruby/lib/lago_ruby/models/invoice_one_off_create_input_invoice_fees_inner.rb index 748ec0b..290ff2f 100644 --- a/ruby/lib/lago_ruby/models/invoice_one_off_create_input_invoice_fees_inner.rb +++ b/ruby/lib/lago_ruby/models/invoice_one_off_create_input_invoice_fees_inner.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/invoice_update_input.rb b/ruby/lib/lago_ruby/models/invoice_update_input.rb index 6e81231..d8fc291 100644 --- a/ruby/lib/lago_ruby/models/invoice_update_input.rb +++ b/ruby/lib/lago_ruby/models/invoice_update_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/invoice_update_input_invoice.rb b/ruby/lib/lago_ruby/models/invoice_update_input_invoice.rb index a646b3a..7e7b20b 100644 --- a/ruby/lib/lago_ruby/models/invoice_update_input_invoice.rb +++ b/ruby/lib/lago_ruby/models/invoice_update_input_invoice.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/invoice_update_input_invoice_metadata_inner.rb b/ruby/lib/lago_ruby/models/invoice_update_input_invoice_metadata_inner.rb index 60f69bc..22d12a5 100644 --- a/ruby/lib/lago_ruby/models/invoice_update_input_invoice_metadata_inner.rb +++ b/ruby/lib/lago_ruby/models/invoice_update_input_invoice_metadata_inner.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/invoiced_usage_object.rb b/ruby/lib/lago_ruby/models/invoiced_usage_object.rb index 99e077a..277e03f 100644 --- a/ruby/lib/lago_ruby/models/invoiced_usage_object.rb +++ b/ruby/lib/lago_ruby/models/invoiced_usage_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/invoiced_usages.rb b/ruby/lib/lago_ruby/models/invoiced_usages.rb index d45ec71..8ca83fd 100644 --- a/ruby/lib/lago_ruby/models/invoiced_usages.rb +++ b/ruby/lib/lago_ruby/models/invoiced_usages.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/invoices_paginated.rb b/ruby/lib/lago_ruby/models/invoices_paginated.rb index 1ced85e..8bae96c 100644 --- a/ruby/lib/lago_ruby/models/invoices_paginated.rb +++ b/ruby/lib/lago_ruby/models/invoices_paginated.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/mrr_object.rb b/ruby/lib/lago_ruby/models/mrr_object.rb index e401ce0..55f40c2 100644 --- a/ruby/lib/lago_ruby/models/mrr_object.rb +++ b/ruby/lib/lago_ruby/models/mrr_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/mrrs.rb b/ruby/lib/lago_ruby/models/mrrs.rb index 0608ef2..147b31d 100644 --- a/ruby/lib/lago_ruby/models/mrrs.rb +++ b/ruby/lib/lago_ruby/models/mrrs.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/organization.rb b/ruby/lib/lago_ruby/models/organization.rb index 702030f..cf08da9 100644 --- a/ruby/lib/lago_ruby/models/organization.rb +++ b/ruby/lib/lago_ruby/models/organization.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/organization_billing_configuration.rb b/ruby/lib/lago_ruby/models/organization_billing_configuration.rb index 06334e4..50eadc2 100644 --- a/ruby/lib/lago_ruby/models/organization_billing_configuration.rb +++ b/ruby/lib/lago_ruby/models/organization_billing_configuration.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/organization_object.rb b/ruby/lib/lago_ruby/models/organization_object.rb index 0422fa9..e504ee1 100644 --- a/ruby/lib/lago_ruby/models/organization_object.rb +++ b/ruby/lib/lago_ruby/models/organization_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -58,6 +58,12 @@ class OrganizationObject # The legal number of your organization. attr_accessor :legal_number + # This parameter configures the method of incrementing invoice numbers for your customers. - `per_customer`: Invoice numbers are incremented individually for each customer. This means every customer will have their own unique sequence of invoice numbers, separate from other customers. It ensures that each customer's invoice numbers follow a distinct and isolated numbering pattern. - `per_organization`: Invoice number incrementation is made across your entire organization. Rather than individual sequences for each customer, all invoices within the organization follow a single, unified numbering system. This creates a continuous and organization-wide sequence for all invoice numbers. Invoices are incremented per month (dynamic value used is YYYYMM), and invoice numbers are reset at the end of each month. The default value for `document_numbering` is set to `per_customer`, meaning that, unless changed, invoice numbers will increment uniquely for each customer. + attr_accessor :document_numbering + + # Sets the prefix for invoices and credit notes. Default is the first three letters of your organization name plus the last four digits of your organization ID. Customizable within 1-10 characters, and automatically capitalized by Lago. + attr_accessor :document_number_prefix + # The net payment term, expressed in days, specifies the duration within which a customer is expected to remit payment after the invoice is finalized. attr_accessor :net_payment_term @@ -71,6 +77,28 @@ class OrganizationObject # List of default organization taxes attr_accessor :taxes + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -89,6 +117,8 @@ def self.attribute_map :'city' => :'city', :'legal_name' => :'legal_name', :'legal_number' => :'legal_number', + :'document_numbering' => :'document_numbering', + :'document_number_prefix' => :'document_number_prefix', :'net_payment_term' => :'net_payment_term', :'tax_identification_number' => :'tax_identification_number', :'timezone' => :'timezone', @@ -120,6 +150,8 @@ def self.openapi_types :'city' => :'String', :'legal_name' => :'String', :'legal_number' => :'String', + :'document_numbering' => :'String', + :'document_number_prefix' => :'String', :'net_payment_term' => :'Integer', :'tax_identification_number' => :'String', :'timezone' => :'Timezone', @@ -229,6 +261,18 @@ def initialize(attributes = {}) self.legal_number = attributes[:'legal_number'] end + if attributes.key?(:'document_numbering') + self.document_numbering = attributes[:'document_numbering'] + else + self.document_numbering = nil + end + + if attributes.key?(:'document_number_prefix') + self.document_number_prefix = attributes[:'document_number_prefix'] + else + self.document_number_prefix = nil + end + if attributes.key?(:'net_payment_term') self.net_payment_term = attributes[:'net_payment_term'] end @@ -267,6 +311,14 @@ def list_invalid_properties invalid_properties.push('invalid value for "name", name cannot be nil.') end + if @document_numbering.nil? + invalid_properties.push('invalid value for "document_numbering", document_numbering cannot be nil.') + end + + if @document_number_prefix.nil? + invalid_properties.push('invalid value for "document_number_prefix", document_number_prefix cannot be nil.') + end + if @billing_configuration.nil? invalid_properties.push('invalid value for "billing_configuration", billing_configuration cannot be nil.') end @@ -280,10 +332,24 @@ def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @lago_id.nil? return false if @name.nil? + return false if @document_numbering.nil? + document_numbering_validator = EnumAttributeValidator.new('String', ["per_customer", "per_organization"]) + return false unless document_numbering_validator.valid?(@document_numbering) + return false if @document_number_prefix.nil? return false if @billing_configuration.nil? true end + # Custom attribute writer method checking allowed values (enum). + # @param [Object] document_numbering Object to be assigned + def document_numbering=(document_numbering) + validator = EnumAttributeValidator.new('String', ["per_customer", "per_organization"]) + unless validator.valid?(document_numbering) + fail ArgumentError, "invalid value for \"document_numbering\", must be one of #{validator.allowable_values}." + end + @document_numbering = document_numbering + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -304,6 +370,8 @@ def ==(o) city == o.city && legal_name == o.legal_name && legal_number == o.legal_number && + document_numbering == o.document_numbering && + document_number_prefix == o.document_number_prefix && net_payment_term == o.net_payment_term && tax_identification_number == o.tax_identification_number && timezone == o.timezone && @@ -320,7 +388,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [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 + [lago_id, name, created_at, webhook_url, webhook_urls, country, default_currency, address_line1, address_line2, state, zipcode, email, city, legal_name, legal_number, document_numbering, document_number_prefix, net_payment_term, tax_identification_number, timezone, billing_configuration, taxes].hash end # Builds the object from hash diff --git a/ruby/lib/lago_ruby/models/organization_update_input.rb b/ruby/lib/lago_ruby/models/organization_update_input.rb index 462601c..5784f07 100644 --- a/ruby/lib/lago_ruby/models/organization_update_input.rb +++ b/ruby/lib/lago_ruby/models/organization_update_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/organization_update_input_organization.rb b/ruby/lib/lago_ruby/models/organization_update_input_organization.rb index 41d7f07..b8675ac 100644 --- a/ruby/lib/lago_ruby/models/organization_update_input_organization.rb +++ b/ruby/lib/lago_ruby/models/organization_update_input_organization.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -46,6 +46,12 @@ class OrganizationUpdateInputOrganization # The legal number of your organization. attr_accessor :legal_number + # This parameter configures the method of incrementing invoice numbers for your customers. - `per_customer`: Invoice numbers are incremented individually for each customer. This means every customer will have their own unique sequence of invoice numbers, separate from other customers. It ensures that each customer's invoice numbers follow a distinct and isolated numbering pattern. - `per_organization`: Invoice number incrementation is made across your entire organization. Rather than individual sequences for each customer, all invoices within the organization follow a single, unified numbering system. This creates a continuous and organization-wide sequence for all invoice numbers. Invoices are incremented per month (dynamic value used is YYYYMM), and invoice numbers are reset at the end of each month. The default value for `document_numbering` is set to `per_customer`, meaning that, unless changed, invoice numbers will increment uniquely for each customer. + attr_accessor :document_numbering + + # Sets the prefix for invoices and credit notes. Default is the first three letters of your organization name plus the last four digits of your organization ID. Customizable within 1-10 characters, and automatically capitalized by Lago. + attr_accessor :document_number_prefix + # The net payment term, expressed in days, specifies the duration within which a customer is expected to remit payment after the invoice is finalized. attr_accessor :net_payment_term @@ -95,6 +101,8 @@ def self.attribute_map :'city' => :'city', :'legal_name' => :'legal_name', :'legal_number' => :'legal_number', + :'document_numbering' => :'document_numbering', + :'document_number_prefix' => :'document_number_prefix', :'net_payment_term' => :'net_payment_term', :'tax_identification_number' => :'tax_identification_number', :'timezone' => :'timezone', @@ -122,6 +130,8 @@ def self.openapi_types :'city' => :'String', :'legal_name' => :'String', :'legal_number' => :'String', + :'document_numbering' => :'String', + :'document_number_prefix' => :'String', :'net_payment_term' => :'Integer', :'tax_identification_number' => :'String', :'timezone' => :'Timezone', @@ -205,6 +215,14 @@ def initialize(attributes = {}) self.legal_number = attributes[:'legal_number'] end + if attributes.key?(:'document_numbering') + self.document_numbering = attributes[:'document_numbering'] + end + + if attributes.key?(:'document_number_prefix') + self.document_number_prefix = attributes[:'document_number_prefix'] + end + if attributes.key?(:'net_payment_term') self.net_payment_term = attributes[:'net_payment_term'] end @@ -240,9 +258,21 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + document_numbering_validator = EnumAttributeValidator.new('String', ["per_customer", "per_organization"]) + return false unless document_numbering_validator.valid?(@document_numbering) true end + # Custom attribute writer method checking allowed values (enum). + # @param [Object] document_numbering Object to be assigned + def document_numbering=(document_numbering) + validator = EnumAttributeValidator.new('String', ["per_customer", "per_organization"]) + unless validator.valid?(document_numbering) + fail ArgumentError, "invalid value for \"document_numbering\", must be one of #{validator.allowable_values}." + end + @document_numbering = document_numbering + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -259,6 +289,8 @@ def ==(o) city == o.city && legal_name == o.legal_name && legal_number == o.legal_number && + document_numbering == o.document_numbering && + document_number_prefix == o.document_number_prefix && net_payment_term == o.net_payment_term && tax_identification_number == o.tax_identification_number && timezone == o.timezone && @@ -275,7 +307,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [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 + [webhook_url, country, default_currency, address_line1, address_line2, state, zipcode, email, city, legal_name, legal_number, document_numbering, document_number_prefix, net_payment_term, tax_identification_number, timezone, email_settings, billing_configuration].hash end # Builds the object from hash diff --git a/ruby/lib/lago_ruby/models/pagination_meta.rb b/ruby/lib/lago_ruby/models/pagination_meta.rb index cf9297c..d7e21e9 100644 --- a/ruby/lib/lago_ruby/models/pagination_meta.rb +++ b/ruby/lib/lago_ruby/models/pagination_meta.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/plan.rb b/ruby/lib/lago_ruby/models/plan.rb index 959bd57..d373000 100644 --- a/ruby/lib/lago_ruby/models/plan.rb +++ b/ruby/lib/lago_ruby/models/plan.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/plan_create_input.rb b/ruby/lib/lago_ruby/models/plan_create_input.rb index 100630d..2972d04 100644 --- a/ruby/lib/lago_ruby/models/plan_create_input.rb +++ b/ruby/lib/lago_ruby/models/plan_create_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/plan_create_input_plan.rb b/ruby/lib/lago_ruby/models/plan_create_input_plan.rb index 066a833..ea4a521 100644 --- a/ruby/lib/lago_ruby/models/plan_create_input_plan.rb +++ b/ruby/lib/lago_ruby/models/plan_create_input_plan.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/plan_create_input_plan_charges_inner.rb b/ruby/lib/lago_ruby/models/plan_create_input_plan_charges_inner.rb index fe773dc..352dfdf 100644 --- a/ruby/lib/lago_ruby/models/plan_create_input_plan_charges_inner.rb +++ b/ruby/lib/lago_ruby/models/plan_create_input_plan_charges_inner.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/plan_create_input_plan_charges_inner_group_properties_inner.rb b/ruby/lib/lago_ruby/models/plan_create_input_plan_charges_inner_group_properties_inner.rb index edf1c7f..f6c42d7 100644 --- a/ruby/lib/lago_ruby/models/plan_create_input_plan_charges_inner_group_properties_inner.rb +++ b/ruby/lib/lago_ruby/models/plan_create_input_plan_charges_inner_group_properties_inner.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/plan_object.rb b/ruby/lib/lago_ruby/models/plan_object.rb index 682f8ef..36832fb 100644 --- a/ruby/lib/lago_ruby/models/plan_object.rb +++ b/ruby/lib/lago_ruby/models/plan_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/plan_overrides_object.rb b/ruby/lib/lago_ruby/models/plan_overrides_object.rb index 55bfb2c..35ed2d1 100644 --- a/ruby/lib/lago_ruby/models/plan_overrides_object.rb +++ b/ruby/lib/lago_ruby/models/plan_overrides_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/plan_overrides_object_charges_inner.rb b/ruby/lib/lago_ruby/models/plan_overrides_object_charges_inner.rb index 28a97f7..ee786e3 100644 --- a/ruby/lib/lago_ruby/models/plan_overrides_object_charges_inner.rb +++ b/ruby/lib/lago_ruby/models/plan_overrides_object_charges_inner.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/plan_update_input.rb b/ruby/lib/lago_ruby/models/plan_update_input.rb index 505af4e..f792f54 100644 --- a/ruby/lib/lago_ruby/models/plan_update_input.rb +++ b/ruby/lib/lago_ruby/models/plan_update_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/plan_update_input_plan.rb b/ruby/lib/lago_ruby/models/plan_update_input_plan.rb index d8e5950..12a8df7 100644 --- a/ruby/lib/lago_ruby/models/plan_update_input_plan.rb +++ b/ruby/lib/lago_ruby/models/plan_update_input_plan.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/plan_update_input_plan_charges_inner.rb b/ruby/lib/lago_ruby/models/plan_update_input_plan_charges_inner.rb index b958461..9477f91 100644 --- a/ruby/lib/lago_ruby/models/plan_update_input_plan_charges_inner.rb +++ b/ruby/lib/lago_ruby/models/plan_update_input_plan_charges_inner.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/plans_paginated.rb b/ruby/lib/lago_ruby/models/plans_paginated.rb index de9b314..19c9af6 100644 --- a/ruby/lib/lago_ruby/models/plans_paginated.rb +++ b/ruby/lib/lago_ruby/models/plans_paginated.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/subscription.rb b/ruby/lib/lago_ruby/models/subscription.rb index 249fe9b..355047e 100644 --- a/ruby/lib/lago_ruby/models/subscription.rb +++ b/ruby/lib/lago_ruby/models/subscription.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/subscription_create_input.rb b/ruby/lib/lago_ruby/models/subscription_create_input.rb index 83f1727..3e10010 100644 --- a/ruby/lib/lago_ruby/models/subscription_create_input.rb +++ b/ruby/lib/lago_ruby/models/subscription_create_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/subscription_create_input_subscription.rb b/ruby/lib/lago_ruby/models/subscription_create_input_subscription.rb index e7b81c8..cfe4b6c 100644 --- a/ruby/lib/lago_ruby/models/subscription_create_input_subscription.rb +++ b/ruby/lib/lago_ruby/models/subscription_create_input_subscription.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/subscription_object.rb b/ruby/lib/lago_ruby/models/subscription_object.rb index f9bbb9e..4779b93 100644 --- a/ruby/lib/lago_ruby/models/subscription_object.rb +++ b/ruby/lib/lago_ruby/models/subscription_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -135,7 +135,7 @@ def self.openapi_types :'terminated_at' => :'Time', :'previous_plan_code' => :'String', :'next_plan_code' => :'String', - :'downgrade_plan_date' => :'Time' + :'downgrade_plan_date' => :'Date' } end diff --git a/ruby/lib/lago_ruby/models/subscription_object_extended.rb b/ruby/lib/lago_ruby/models/subscription_object_extended.rb index 020c713..25b95af 100644 --- a/ruby/lib/lago_ruby/models/subscription_object_extended.rb +++ b/ruby/lib/lago_ruby/models/subscription_object_extended.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -138,7 +138,7 @@ def self.openapi_types :'terminated_at' => :'Time', :'previous_plan_code' => :'String', :'next_plan_code' => :'String', - :'downgrade_plan_date' => :'Time', + :'downgrade_plan_date' => :'Date', :'plan' => :'PlanObject' } end diff --git a/ruby/lib/lago_ruby/models/subscription_update_input.rb b/ruby/lib/lago_ruby/models/subscription_update_input.rb index c854352..f986ef4 100644 --- a/ruby/lib/lago_ruby/models/subscription_update_input.rb +++ b/ruby/lib/lago_ruby/models/subscription_update_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -15,11 +15,37 @@ module LagoAPI class SubscriptionUpdateInput + # If the field is not defined and multiple `active` and `pending` subscriptions exists, Lago will update the `active` subscription. However, if you wish to update a `pending` subscription, please ensure that you include the `status` attribute with the `pending` value in your request body. + attr_accessor :status + attr_accessor :subscription + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'status' => :'status', :'subscription' => :'subscription' } end @@ -32,6 +58,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :'status' => :'String', :'subscription' => :'SubscriptionUpdateInputSubscription' } end @@ -57,6 +84,10 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + if attributes.key?(:'subscription') self.subscription = attributes[:'subscription'] else @@ -80,15 +111,28 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + status_validator = EnumAttributeValidator.new('String', ["active", "pending"]) + return false unless status_validator.valid?(@status) return false if @subscription.nil? true end + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["active", "pending"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && + status == o.status && subscription == o.subscription end @@ -101,7 +145,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [subscription].hash + [status, subscription].hash end # Builds the object from hash diff --git a/ruby/lib/lago_ruby/models/subscription_update_input_subscription.rb b/ruby/lib/lago_ruby/models/subscription_update_input_subscription.rb index 4a2d7aa..634d715 100644 --- a/ruby/lib/lago_ruby/models/subscription_update_input_subscription.rb +++ b/ruby/lib/lago_ruby/models/subscription_update_input_subscription.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/subscriptions_paginated.rb b/ruby/lib/lago_ruby/models/subscriptions_paginated.rb index dacecef..f343e9f 100644 --- a/ruby/lib/lago_ruby/models/subscriptions_paginated.rb +++ b/ruby/lib/lago_ruby/models/subscriptions_paginated.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/tax.rb b/ruby/lib/lago_ruby/models/tax.rb index 7584d79..870d7d4 100644 --- a/ruby/lib/lago_ruby/models/tax.rb +++ b/ruby/lib/lago_ruby/models/tax.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/tax_base_input.rb b/ruby/lib/lago_ruby/models/tax_base_input.rb index 8b1d3b1..c8347ea 100644 --- a/ruby/lib/lago_ruby/models/tax_base_input.rb +++ b/ruby/lib/lago_ruby/models/tax_base_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/tax_create_input.rb b/ruby/lib/lago_ruby/models/tax_create_input.rb index d52b092..965342e 100644 --- a/ruby/lib/lago_ruby/models/tax_create_input.rb +++ b/ruby/lib/lago_ruby/models/tax_create_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/tax_create_input_tax.rb b/ruby/lib/lago_ruby/models/tax_create_input_tax.rb index 77dea04..b7a6501 100644 --- a/ruby/lib/lago_ruby/models/tax_create_input_tax.rb +++ b/ruby/lib/lago_ruby/models/tax_create_input_tax.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/tax_object.rb b/ruby/lib/lago_ruby/models/tax_object.rb index c418342..bedeca4 100644 --- a/ruby/lib/lago_ruby/models/tax_object.rb +++ b/ruby/lib/lago_ruby/models/tax_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/tax_update_input.rb b/ruby/lib/lago_ruby/models/tax_update_input.rb index fe3a75b..ad998a2 100644 --- a/ruby/lib/lago_ruby/models/tax_update_input.rb +++ b/ruby/lib/lago_ruby/models/tax_update_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/taxes_paginated.rb b/ruby/lib/lago_ruby/models/taxes_paginated.rb index 0647ae3..606fedd 100644 --- a/ruby/lib/lago_ruby/models/taxes_paginated.rb +++ b/ruby/lib/lago_ruby/models/taxes_paginated.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/timezone.rb b/ruby/lib/lago_ruby/models/timezone.rb index a5d6aa6..beb576c 100644 --- a/ruby/lib/lago_ruby/models/timezone.rb +++ b/ruby/lib/lago_ruby/models/timezone.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/wallet.rb b/ruby/lib/lago_ruby/models/wallet.rb index 25c153a..fe85af3 100644 --- a/ruby/lib/lago_ruby/models/wallet.rb +++ b/ruby/lib/lago_ruby/models/wallet.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/wallet_create_input.rb b/ruby/lib/lago_ruby/models/wallet_create_input.rb index 53e931e..4058811 100644 --- a/ruby/lib/lago_ruby/models/wallet_create_input.rb +++ b/ruby/lib/lago_ruby/models/wallet_create_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/wallet_create_input_wallet.rb b/ruby/lib/lago_ruby/models/wallet_create_input_wallet.rb index 7eda263..73f339a 100644 --- a/ruby/lib/lago_ruby/models/wallet_create_input_wallet.rb +++ b/ruby/lib/lago_ruby/models/wallet_create_input_wallet.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -35,6 +35,9 @@ class WalletCreateInputWallet # The date and time that determines when the wallet will expire. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC). attr_accessor :expiration_at + # List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. + attr_accessor :recurring_transaction_rules + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -44,7 +47,8 @@ def self.attribute_map :'paid_credits' => :'paid_credits', :'granted_credits' => :'granted_credits', :'external_customer_id' => :'external_customer_id', - :'expiration_at' => :'expiration_at' + :'expiration_at' => :'expiration_at', + :'recurring_transaction_rules' => :'recurring_transaction_rules' } end @@ -62,7 +66,8 @@ def self.openapi_types :'paid_credits' => :'String', :'granted_credits' => :'String', :'external_customer_id' => :'String', - :'expiration_at' => :'Time' + :'expiration_at' => :'Time', + :'recurring_transaction_rules' => :'Array' } end @@ -71,7 +76,7 @@ def self.openapi_nullable Set.new([ :'paid_credits', :'granted_credits', - :'expiration_at' + :'expiration_at', ]) end @@ -123,6 +128,12 @@ def initialize(attributes = {}) if attributes.key?(:'expiration_at') self.expiration_at = attributes[:'expiration_at'] end + + if attributes.key?(:'recurring_transaction_rules') + if (value = attributes[:'recurring_transaction_rules']).is_a?(Array) + self.recurring_transaction_rules = value + end + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -221,7 +232,8 @@ def ==(o) paid_credits == o.paid_credits && granted_credits == o.granted_credits && external_customer_id == o.external_customer_id && - expiration_at == o.expiration_at + expiration_at == o.expiration_at && + recurring_transaction_rules == o.recurring_transaction_rules end # @see the `==` method @@ -233,7 +245,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [name, rate_amount, currency, paid_credits, granted_credits, external_customer_id, expiration_at].hash + [name, rate_amount, currency, paid_credits, granted_credits, external_customer_id, expiration_at, recurring_transaction_rules].hash end # Builds the object from hash diff --git a/ruby/lib/lago_ruby/models/wallet_create_input_wallet_recurring_transaction_rules_inner.rb b/ruby/lib/lago_ruby/models/wallet_create_input_wallet_recurring_transaction_rules_inner.rb new file mode 100644 index 0000000..f4e52ff --- /dev/null +++ b/ruby/lib/lago_ruby/models/wallet_create_input_wallet_recurring_transaction_rules_inner.rb @@ -0,0 +1,310 @@ +=begin +#Lago API documentation + +#Lago API allows your application to push customer information and metrics (events) from your application to the billing application. + +The version of the OpenAPI document: 0.53.0-beta +Contact: tech@getlago.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.4.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module LagoAPI + # Object that represents rule for wallet recurring transactions. + class WalletCreateInputWalletRecurringTransactionRulesInner + # The rule type. Possible values are `interval` or `threshold`. + attr_accessor :rule_type + + # The interval used for recurring top-up. It represents the frequency at which automatic top-up occurs. The interval can be one of the following values: `weekly`, `monthly`, `quarterly` or `yearly`. Required only when rule type is `interval`. + attr_accessor :interval + + # The threshold for recurring top-ups is the value at which an automatic top-up is triggered. For example, if this threshold is set at 10 credits, an automatic top-up will occur whenever the wallet balance falls to or below 10 credits. Required only when rule type is set to `threshold`. + attr_accessor :threshold_credits + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'rule_type' => :'rule_type', + :'interval' => :'interval', + :'threshold_credits' => :'threshold_credits' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'rule_type' => :'String', + :'interval' => :'String', + :'threshold_credits' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `LagoAPI::WalletCreateInputWalletRecurringTransactionRulesInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `LagoAPI::WalletCreateInputWalletRecurringTransactionRulesInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'rule_type') + self.rule_type = attributes[:'rule_type'] + else + self.rule_type = nil + end + + if attributes.key?(:'interval') + self.interval = attributes[:'interval'] + end + + if attributes.key?(:'threshold_credits') + self.threshold_credits = attributes[:'threshold_credits'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @rule_type.nil? + invalid_properties.push('invalid value for "rule_type", rule_type cannot be nil.') + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if !@threshold_credits.nil? && @threshold_credits !~ pattern + invalid_properties.push("invalid value for \"threshold_credits\", must conform to the pattern #{pattern}.") + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @rule_type.nil? + rule_type_validator = EnumAttributeValidator.new('String', ["interval", "threshold"]) + return false unless rule_type_validator.valid?(@rule_type) + interval_validator = EnumAttributeValidator.new('String', ["weekly", "monthly", "quarterly", "yearly"]) + return false unless interval_validator.valid?(@interval) + return false if !@threshold_credits.nil? && @threshold_credits !~ Regexp.new(/^[0-9]+.?[0-9]*$/) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] rule_type Object to be assigned + def rule_type=(rule_type) + validator = EnumAttributeValidator.new('String', ["interval", "threshold"]) + unless validator.valid?(rule_type) + fail ArgumentError, "invalid value for \"rule_type\", must be one of #{validator.allowable_values}." + end + @rule_type = rule_type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] interval Object to be assigned + def interval=(interval) + validator = EnumAttributeValidator.new('String', ["weekly", "monthly", "quarterly", "yearly"]) + unless validator.valid?(interval) + fail ArgumentError, "invalid value for \"interval\", must be one of #{validator.allowable_values}." + end + @interval = interval + end + + # Custom attribute writer method with validation + # @param [Object] threshold_credits Value to be assigned + def threshold_credits=(threshold_credits) + if threshold_credits.nil? + fail ArgumentError, 'threshold_credits cannot be nil' + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if threshold_credits !~ pattern + fail ArgumentError, "invalid value for \"threshold_credits\", must conform to the pattern #{pattern}." + end + + @threshold_credits = threshold_credits + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + rule_type == o.rule_type && + interval == o.interval && + threshold_credits == o.threshold_credits + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [rule_type, interval, threshold_credits].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = LagoAPI.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby/lib/lago_ruby/models/wallet_object.rb b/ruby/lib/lago_ruby/models/wallet_object.rb index 3cafe90..d8b9507 100644 --- a/ruby/lib/lago_ruby/models/wallet_object.rb +++ b/ruby/lib/lago_ruby/models/wallet_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -59,6 +59,21 @@ class WalletObject # The date of terminaison of the wallet. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC). attr_accessor :terminated_at + # List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. + attr_accessor :recurring_transaction_rules + + # The wallet ongoing balance expressed in cents. + attr_accessor :ongoing_balance_cents + + # The wallet ongoing usage balance expressed in cents. + attr_accessor :ongoing_usage_balance_cents + + # The wallet ongoing balance expressed in credits. + attr_accessor :credits_ongoing_balance + + # The wallet ongoing usage balance expressed in credits. + attr_accessor :credits_ongoing_usage_balance + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -98,7 +113,12 @@ def self.attribute_map :'expiration_at' => :'expiration_at', :'last_balance_sync_at' => :'last_balance_sync_at', :'last_consumed_credit_at' => :'last_consumed_credit_at', - :'terminated_at' => :'terminated_at' + :'terminated_at' => :'terminated_at', + :'recurring_transaction_rules' => :'recurring_transaction_rules', + :'ongoing_balance_cents' => :'ongoing_balance_cents', + :'ongoing_usage_balance_cents' => :'ongoing_usage_balance_cents', + :'credits_ongoing_balance' => :'credits_ongoing_balance', + :'credits_ongoing_usage_balance' => :'credits_ongoing_usage_balance' } end @@ -124,7 +144,12 @@ def self.openapi_types :'expiration_at' => :'Time', :'last_balance_sync_at' => :'Time', :'last_consumed_credit_at' => :'Time', - :'terminated_at' => :'Time' + :'terminated_at' => :'Time', + :'recurring_transaction_rules' => :'Array', + :'ongoing_balance_cents' => :'Integer', + :'ongoing_usage_balance_cents' => :'Integer', + :'credits_ongoing_balance' => :'String', + :'credits_ongoing_usage_balance' => :'String' } end @@ -134,7 +159,7 @@ def self.openapi_nullable :'expiration_at', :'last_balance_sync_at', :'last_consumed_credit_at', - :'terminated_at' + :'terminated_at', ]) end @@ -232,6 +257,36 @@ def initialize(attributes = {}) if attributes.key?(:'terminated_at') self.terminated_at = attributes[:'terminated_at'] end + + if attributes.key?(:'recurring_transaction_rules') + if (value = attributes[:'recurring_transaction_rules']).is_a?(Array) + self.recurring_transaction_rules = value + end + end + + if attributes.key?(:'ongoing_balance_cents') + self.ongoing_balance_cents = attributes[:'ongoing_balance_cents'] + else + self.ongoing_balance_cents = nil + end + + if attributes.key?(:'ongoing_usage_balance_cents') + self.ongoing_usage_balance_cents = attributes[:'ongoing_usage_balance_cents'] + else + self.ongoing_usage_balance_cents = nil + end + + if attributes.key?(:'credits_ongoing_balance') + self.credits_ongoing_balance = attributes[:'credits_ongoing_balance'] + else + self.credits_ongoing_balance = nil + end + + if attributes.key?(:'credits_ongoing_usage_balance') + self.credits_ongoing_usage_balance = attributes[:'credits_ongoing_usage_balance'] + else + self.credits_ongoing_usage_balance = nil + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -294,6 +349,32 @@ def list_invalid_properties invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') end + if @ongoing_balance_cents.nil? + invalid_properties.push('invalid value for "ongoing_balance_cents", ongoing_balance_cents cannot be nil.') + end + + if @ongoing_usage_balance_cents.nil? + invalid_properties.push('invalid value for "ongoing_usage_balance_cents", ongoing_usage_balance_cents cannot be nil.') + end + + if @credits_ongoing_balance.nil? + invalid_properties.push('invalid value for "credits_ongoing_balance", credits_ongoing_balance cannot be nil.') + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if @credits_ongoing_balance !~ pattern + invalid_properties.push("invalid value for \"credits_ongoing_balance\", must conform to the pattern #{pattern}.") + end + + if @credits_ongoing_usage_balance.nil? + invalid_properties.push('invalid value for "credits_ongoing_usage_balance", credits_ongoing_usage_balance cannot be nil.') + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if @credits_ongoing_usage_balance !~ pattern + invalid_properties.push("invalid value for \"credits_ongoing_usage_balance\", must conform to the pattern #{pattern}.") + end + invalid_properties end @@ -316,6 +397,12 @@ def valid? return false if @consumed_credits.nil? return false if @consumed_credits !~ Regexp.new(/^[0-9]+.?[0-9]*$/) return false if @created_at.nil? + return false if @ongoing_balance_cents.nil? + return false if @ongoing_usage_balance_cents.nil? + return false if @credits_ongoing_balance.nil? + return false if @credits_ongoing_balance !~ Regexp.new(/^[0-9]+.?[0-9]*$/) + return false if @credits_ongoing_usage_balance.nil? + return false if @credits_ongoing_usage_balance !~ Regexp.new(/^[0-9]+.?[0-9]*$/) true end @@ -374,6 +461,36 @@ def consumed_credits=(consumed_credits) @consumed_credits = consumed_credits end + # Custom attribute writer method with validation + # @param [Object] credits_ongoing_balance Value to be assigned + def credits_ongoing_balance=(credits_ongoing_balance) + if credits_ongoing_balance.nil? + fail ArgumentError, 'credits_ongoing_balance cannot be nil' + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if credits_ongoing_balance !~ pattern + fail ArgumentError, "invalid value for \"credits_ongoing_balance\", must conform to the pattern #{pattern}." + end + + @credits_ongoing_balance = credits_ongoing_balance + end + + # Custom attribute writer method with validation + # @param [Object] credits_ongoing_usage_balance Value to be assigned + def credits_ongoing_usage_balance=(credits_ongoing_usage_balance) + if credits_ongoing_usage_balance.nil? + fail ArgumentError, 'credits_ongoing_usage_balance cannot be nil' + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if credits_ongoing_usage_balance !~ pattern + fail ArgumentError, "invalid value for \"credits_ongoing_usage_balance\", must conform to the pattern #{pattern}." + end + + @credits_ongoing_usage_balance = credits_ongoing_usage_balance + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -393,7 +510,12 @@ def ==(o) expiration_at == o.expiration_at && last_balance_sync_at == o.last_balance_sync_at && last_consumed_credit_at == o.last_consumed_credit_at && - terminated_at == o.terminated_at + terminated_at == o.terminated_at && + recurring_transaction_rules == o.recurring_transaction_rules && + ongoing_balance_cents == o.ongoing_balance_cents && + ongoing_usage_balance_cents == o.ongoing_usage_balance_cents && + credits_ongoing_balance == o.credits_ongoing_balance && + credits_ongoing_usage_balance == o.credits_ongoing_usage_balance end # @see the `==` method @@ -405,7 +527,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [lago_id, lago_customer_id, external_customer_id, status, currency, name, rate_amount, credits_balance, balance_cents, consumed_credits, created_at, expiration_at, last_balance_sync_at, last_consumed_credit_at, terminated_at].hash + [lago_id, lago_customer_id, external_customer_id, status, currency, name, rate_amount, credits_balance, balance_cents, consumed_credits, created_at, expiration_at, last_balance_sync_at, last_consumed_credit_at, terminated_at, recurring_transaction_rules, ongoing_balance_cents, ongoing_usage_balance_cents, credits_ongoing_balance, credits_ongoing_usage_balance].hash end # Builds the object from hash diff --git a/ruby/lib/lago_ruby/models/wallet_object_recurring_transaction_rules_inner.rb b/ruby/lib/lago_ruby/models/wallet_object_recurring_transaction_rules_inner.rb new file mode 100644 index 0000000..a62a0df --- /dev/null +++ b/ruby/lib/lago_ruby/models/wallet_object_recurring_transaction_rules_inner.rb @@ -0,0 +1,420 @@ +=begin +#Lago API documentation + +#Lago API allows your application to push customer information and metrics (events) from your application to the billing application. + +The version of the OpenAPI document: 0.53.0-beta +Contact: tech@getlago.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.4.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module LagoAPI + # Object that represents rule for wallet recurring transactions. + class WalletObjectRecurringTransactionRulesInner + # A unique identifier for the recurring transaction rule in the Lago application. Can be used to update a recurring transaction rule. + attr_accessor :lago_id + + # The rule type. Possible values are `interval` or `threshold`. + attr_accessor :rule_type + + # The interval used for recurring top-up. It represents the frequency at which automatic top-up occurs. The interval can be one of the following values: `weekly`, `monthly`, `quarterly` or `yearly`. Required only if rule type is set to `interval`. + attr_accessor :interval + + # The threshold for recurring top-ups is the value at which an automatic top-up is triggered. For example, if this threshold is set at 10 credits, an automatic top-up will occur whenever the wallet balance falls to or below 10 credits. Required only when rule type is set to `threshold`. + attr_accessor :threshold_credits + + # The number of paid credits. Required only if there is no granted credits. + attr_accessor :paid_credits + + # The number of free granted credits. Required only if there is no paid credits. + attr_accessor :granted_credits + + # The date of the metadata object creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). The creation_date provides a standardized and internationally recognized timestamp for when the metadata object was created + attr_accessor :created_at + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'lago_id' => :'lago_id', + :'rule_type' => :'rule_type', + :'interval' => :'interval', + :'threshold_credits' => :'threshold_credits', + :'paid_credits' => :'paid_credits', + :'granted_credits' => :'granted_credits', + :'created_at' => :'created_at' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'lago_id' => :'String', + :'rule_type' => :'String', + :'interval' => :'String', + :'threshold_credits' => :'String', + :'paid_credits' => :'String', + :'granted_credits' => :'String', + :'created_at' => :'Time' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `LagoAPI::WalletObjectRecurringTransactionRulesInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `LagoAPI::WalletObjectRecurringTransactionRulesInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'lago_id') + self.lago_id = attributes[:'lago_id'] + else + self.lago_id = nil + end + + if attributes.key?(:'rule_type') + self.rule_type = attributes[:'rule_type'] + else + self.rule_type = nil + end + + if attributes.key?(:'interval') + self.interval = attributes[:'interval'] + end + + if attributes.key?(:'threshold_credits') + self.threshold_credits = attributes[:'threshold_credits'] + end + + if attributes.key?(:'paid_credits') + self.paid_credits = attributes[:'paid_credits'] + else + self.paid_credits = nil + end + + if attributes.key?(:'granted_credits') + self.granted_credits = attributes[:'granted_credits'] + else + self.granted_credits = nil + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + else + self.created_at = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @lago_id.nil? + invalid_properties.push('invalid value for "lago_id", lago_id cannot be nil.') + end + + if @rule_type.nil? + invalid_properties.push('invalid value for "rule_type", rule_type cannot be nil.') + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if !@threshold_credits.nil? && @threshold_credits !~ pattern + invalid_properties.push("invalid value for \"threshold_credits\", must conform to the pattern #{pattern}.") + end + + if @paid_credits.nil? + invalid_properties.push('invalid value for "paid_credits", paid_credits cannot be nil.') + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if @paid_credits !~ pattern + invalid_properties.push("invalid value for \"paid_credits\", must conform to the pattern #{pattern}.") + end + + if @granted_credits.nil? + invalid_properties.push('invalid value for "granted_credits", granted_credits cannot be nil.') + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if @granted_credits !~ pattern + invalid_properties.push("invalid value for \"granted_credits\", must conform to the pattern #{pattern}.") + end + + if @created_at.nil? + invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @lago_id.nil? + return false if @rule_type.nil? + rule_type_validator = EnumAttributeValidator.new('String', ["interval", "threshold"]) + return false unless rule_type_validator.valid?(@rule_type) + interval_validator = EnumAttributeValidator.new('String', ["weekly", "monthly", "quarterly", "yearly"]) + return false unless interval_validator.valid?(@interval) + return false if !@threshold_credits.nil? && @threshold_credits !~ Regexp.new(/^[0-9]+.?[0-9]*$/) + return false if @paid_credits.nil? + return false if @paid_credits !~ Regexp.new(/^[0-9]+.?[0-9]*$/) + return false if @granted_credits.nil? + return false if @granted_credits !~ Regexp.new(/^[0-9]+.?[0-9]*$/) + return false if @created_at.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] rule_type Object to be assigned + def rule_type=(rule_type) + validator = EnumAttributeValidator.new('String', ["interval", "threshold"]) + unless validator.valid?(rule_type) + fail ArgumentError, "invalid value for \"rule_type\", must be one of #{validator.allowable_values}." + end + @rule_type = rule_type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] interval Object to be assigned + def interval=(interval) + validator = EnumAttributeValidator.new('String', ["weekly", "monthly", "quarterly", "yearly"]) + unless validator.valid?(interval) + fail ArgumentError, "invalid value for \"interval\", must be one of #{validator.allowable_values}." + end + @interval = interval + end + + # Custom attribute writer method with validation + # @param [Object] threshold_credits Value to be assigned + def threshold_credits=(threshold_credits) + if threshold_credits.nil? + fail ArgumentError, 'threshold_credits cannot be nil' + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if threshold_credits !~ pattern + fail ArgumentError, "invalid value for \"threshold_credits\", must conform to the pattern #{pattern}." + end + + @threshold_credits = threshold_credits + end + + # Custom attribute writer method with validation + # @param [Object] paid_credits Value to be assigned + def paid_credits=(paid_credits) + if paid_credits.nil? + fail ArgumentError, 'paid_credits cannot be nil' + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if paid_credits !~ pattern + fail ArgumentError, "invalid value for \"paid_credits\", must conform to the pattern #{pattern}." + end + + @paid_credits = paid_credits + end + + # Custom attribute writer method with validation + # @param [Object] granted_credits Value to be assigned + def granted_credits=(granted_credits) + if granted_credits.nil? + fail ArgumentError, 'granted_credits cannot be nil' + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if granted_credits !~ pattern + fail ArgumentError, "invalid value for \"granted_credits\", must conform to the pattern #{pattern}." + end + + @granted_credits = granted_credits + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + lago_id == o.lago_id && + rule_type == o.rule_type && + interval == o.interval && + threshold_credits == o.threshold_credits && + paid_credits == o.paid_credits && + granted_credits == o.granted_credits && + created_at == o.created_at + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [lago_id, rule_type, interval, threshold_credits, paid_credits, granted_credits, created_at].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = LagoAPI.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby/lib/lago_ruby/models/wallet_transaction_create_input.rb b/ruby/lib/lago_ruby/models/wallet_transaction_create_input.rb index 1db20cd..0d2e1e7 100644 --- a/ruby/lib/lago_ruby/models/wallet_transaction_create_input.rb +++ b/ruby/lib/lago_ruby/models/wallet_transaction_create_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/wallet_transaction_create_input_wallet_transaction.rb b/ruby/lib/lago_ruby/models/wallet_transaction_create_input_wallet_transaction.rb index 5156871..6b5eb87 100644 --- a/ruby/lib/lago_ruby/models/wallet_transaction_create_input_wallet_transaction.rb +++ b/ruby/lib/lago_ruby/models/wallet_transaction_create_input_wallet_transaction.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/wallet_transaction_object.rb b/ruby/lib/lago_ruby/models/wallet_transaction_object.rb index b206342..2060297 100644 --- a/ruby/lib/lago_ruby/models/wallet_transaction_object.rb +++ b/ruby/lib/lago_ruby/models/wallet_transaction_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/wallet_transactions.rb b/ruby/lib/lago_ruby/models/wallet_transactions.rb index 2861a4f..fd3f6f0 100644 --- a/ruby/lib/lago_ruby/models/wallet_transactions.rb +++ b/ruby/lib/lago_ruby/models/wallet_transactions.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/wallet_transactions_paginated.rb b/ruby/lib/lago_ruby/models/wallet_transactions_paginated.rb index bf28e1f..48496fa 100644 --- a/ruby/lib/lago_ruby/models/wallet_transactions_paginated.rb +++ b/ruby/lib/lago_ruby/models/wallet_transactions_paginated.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/wallet_update_input.rb b/ruby/lib/lago_ruby/models/wallet_update_input.rb index 166ca4d..afa51fe 100644 --- a/ruby/lib/lago_ruby/models/wallet_update_input.rb +++ b/ruby/lib/lago_ruby/models/wallet_update_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/wallet_update_input_wallet.rb b/ruby/lib/lago_ruby/models/wallet_update_input_wallet.rb index c87266d..86056fc 100644 --- a/ruby/lib/lago_ruby/models/wallet_update_input_wallet.rb +++ b/ruby/lib/lago_ruby/models/wallet_update_input_wallet.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end @@ -21,11 +21,15 @@ class WalletUpdateInputWallet # The date and time that determines when the wallet will expire. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC). attr_accessor :expiration_at + # List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. + attr_accessor :recurring_transaction_rules + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'name' => :'name', - :'expiration_at' => :'expiration_at' + :'expiration_at' => :'expiration_at', + :'recurring_transaction_rules' => :'recurring_transaction_rules' } end @@ -38,7 +42,8 @@ def self.acceptable_attributes def self.openapi_types { :'name' => :'String', - :'expiration_at' => :'Time' + :'expiration_at' => :'Time', + :'recurring_transaction_rules' => :'Array' } end @@ -46,7 +51,7 @@ def self.openapi_types def self.openapi_nullable Set.new([ :'name', - :'expiration_at' + :'expiration_at', ]) end @@ -72,6 +77,12 @@ def initialize(attributes = {}) if attributes.key?(:'expiration_at') self.expiration_at = attributes[:'expiration_at'] end + + if attributes.key?(:'recurring_transaction_rules') + if (value = attributes[:'recurring_transaction_rules']).is_a?(Array) + self.recurring_transaction_rules = value + end + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -95,7 +106,8 @@ def ==(o) return true if self.equal?(o) self.class == o.class && name == o.name && - expiration_at == o.expiration_at + expiration_at == o.expiration_at && + recurring_transaction_rules == o.recurring_transaction_rules end # @see the `==` method @@ -107,7 +119,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [name, expiration_at].hash + [name, expiration_at, recurring_transaction_rules].hash end # Builds the object from hash diff --git a/ruby/lib/lago_ruby/models/wallet_update_input_wallet_recurring_transaction_rules_inner.rb b/ruby/lib/lago_ruby/models/wallet_update_input_wallet_recurring_transaction_rules_inner.rb new file mode 100644 index 0000000..543cf5e --- /dev/null +++ b/ruby/lib/lago_ruby/models/wallet_update_input_wallet_recurring_transaction_rules_inner.rb @@ -0,0 +1,375 @@ +=begin +#Lago API documentation + +#Lago API allows your application to push customer information and metrics (events) from your application to the billing application. + +The version of the OpenAPI document: 0.53.0-beta +Contact: tech@getlago.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.4.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module LagoAPI + # Object that represents rule for wallet recurring transactions. + class WalletUpdateInputWalletRecurringTransactionRulesInner + # A unique identifier for the recurring transaction rule in the Lago application. Can be used to update a recurring transaction rule. + attr_accessor :lago_id + + # The rule type. Possible values are `interval` or `threshold`. + attr_accessor :rule_type + + # The interval used for recurring top-up. It represents the frequency at which automatic top-up occurs. The interval can be one of the following values: `weekly`, `monthly`, `quarterly` or `yearly`. Required only when rule type is set to `interval`. + attr_accessor :interval + + # The threshold for recurring top-ups is the value at which an automatic top-up is triggered. For example, if this threshold is set at 10 credits, an automatic top-up will occur whenever the wallet balance falls to or below 10 credits. Required only when rule type is set to `threshold`. + attr_accessor :threshold_credits + + # The number of paid credits. Required only if there is no granted credits. + attr_accessor :paid_credits + + # The number of free granted credits. Required only if there is no paid credits. + attr_accessor :granted_credits + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'lago_id' => :'lago_id', + :'rule_type' => :'rule_type', + :'interval' => :'interval', + :'threshold_credits' => :'threshold_credits', + :'paid_credits' => :'paid_credits', + :'granted_credits' => :'granted_credits' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'lago_id' => :'String', + :'rule_type' => :'String', + :'interval' => :'String', + :'threshold_credits' => :'String', + :'paid_credits' => :'String', + :'granted_credits' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `LagoAPI::WalletUpdateInputWalletRecurringTransactionRulesInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `LagoAPI::WalletUpdateInputWalletRecurringTransactionRulesInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'lago_id') + self.lago_id = attributes[:'lago_id'] + end + + if attributes.key?(:'rule_type') + self.rule_type = attributes[:'rule_type'] + end + + if attributes.key?(:'interval') + self.interval = attributes[:'interval'] + end + + if attributes.key?(:'threshold_credits') + self.threshold_credits = attributes[:'threshold_credits'] + end + + if attributes.key?(:'paid_credits') + self.paid_credits = attributes[:'paid_credits'] + end + + if attributes.key?(:'granted_credits') + self.granted_credits = attributes[:'granted_credits'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if !@threshold_credits.nil? && @threshold_credits !~ pattern + invalid_properties.push("invalid value for \"threshold_credits\", must conform to the pattern #{pattern}.") + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if !@paid_credits.nil? && @paid_credits !~ pattern + invalid_properties.push("invalid value for \"paid_credits\", must conform to the pattern #{pattern}.") + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if !@granted_credits.nil? && @granted_credits !~ pattern + invalid_properties.push("invalid value for \"granted_credits\", must conform to the pattern #{pattern}.") + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + rule_type_validator = EnumAttributeValidator.new('String', ["interval", "threshold"]) + return false unless rule_type_validator.valid?(@rule_type) + interval_validator = EnumAttributeValidator.new('String', ["weekly", "monthly", "quarterly", "yearly"]) + return false unless interval_validator.valid?(@interval) + return false if !@threshold_credits.nil? && @threshold_credits !~ Regexp.new(/^[0-9]+.?[0-9]*$/) + return false if !@paid_credits.nil? && @paid_credits !~ Regexp.new(/^[0-9]+.?[0-9]*$/) + return false if !@granted_credits.nil? && @granted_credits !~ Regexp.new(/^[0-9]+.?[0-9]*$/) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] rule_type Object to be assigned + def rule_type=(rule_type) + validator = EnumAttributeValidator.new('String', ["interval", "threshold"]) + unless validator.valid?(rule_type) + fail ArgumentError, "invalid value for \"rule_type\", must be one of #{validator.allowable_values}." + end + @rule_type = rule_type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] interval Object to be assigned + def interval=(interval) + validator = EnumAttributeValidator.new('String', ["weekly", "monthly", "quarterly", "yearly"]) + unless validator.valid?(interval) + fail ArgumentError, "invalid value for \"interval\", must be one of #{validator.allowable_values}." + end + @interval = interval + end + + # Custom attribute writer method with validation + # @param [Object] threshold_credits Value to be assigned + def threshold_credits=(threshold_credits) + if threshold_credits.nil? + fail ArgumentError, 'threshold_credits cannot be nil' + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if threshold_credits !~ pattern + fail ArgumentError, "invalid value for \"threshold_credits\", must conform to the pattern #{pattern}." + end + + @threshold_credits = threshold_credits + end + + # Custom attribute writer method with validation + # @param [Object] paid_credits Value to be assigned + def paid_credits=(paid_credits) + if paid_credits.nil? + fail ArgumentError, 'paid_credits cannot be nil' + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if paid_credits !~ pattern + fail ArgumentError, "invalid value for \"paid_credits\", must conform to the pattern #{pattern}." + end + + @paid_credits = paid_credits + end + + # Custom attribute writer method with validation + # @param [Object] granted_credits Value to be assigned + def granted_credits=(granted_credits) + if granted_credits.nil? + fail ArgumentError, 'granted_credits cannot be nil' + end + + pattern = Regexp.new(/^[0-9]+.?[0-9]*$/) + if granted_credits !~ pattern + fail ArgumentError, "invalid value for \"granted_credits\", must conform to the pattern #{pattern}." + end + + @granted_credits = granted_credits + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + lago_id == o.lago_id && + rule_type == o.rule_type && + interval == o.interval && + threshold_credits == o.threshold_credits && + paid_credits == o.paid_credits && + granted_credits == o.granted_credits + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [lago_id, rule_type, interval, threshold_credits, paid_credits, granted_credits].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = LagoAPI.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby/lib/lago_ruby/models/wallets_paginated.rb b/ruby/lib/lago_ruby/models/wallets_paginated.rb index cc878e6..10cdbd1 100644 --- a/ruby/lib/lago_ruby/models/wallets_paginated.rb +++ b/ruby/lib/lago_ruby/models/wallets_paginated.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/webhook_endpoint.rb b/ruby/lib/lago_ruby/models/webhook_endpoint.rb index dcc3c96..d4cdd09 100644 --- a/ruby/lib/lago_ruby/models/webhook_endpoint.rb +++ b/ruby/lib/lago_ruby/models/webhook_endpoint.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/webhook_endpoint_create_input.rb b/ruby/lib/lago_ruby/models/webhook_endpoint_create_input.rb index 68d7a84..acc6085 100644 --- a/ruby/lib/lago_ruby/models/webhook_endpoint_create_input.rb +++ b/ruby/lib/lago_ruby/models/webhook_endpoint_create_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/webhook_endpoint_create_input_webhook_endpoint.rb b/ruby/lib/lago_ruby/models/webhook_endpoint_create_input_webhook_endpoint.rb index 67a7df8..bfa3c05 100644 --- a/ruby/lib/lago_ruby/models/webhook_endpoint_create_input_webhook_endpoint.rb +++ b/ruby/lib/lago_ruby/models/webhook_endpoint_create_input_webhook_endpoint.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/webhook_endpoint_object.rb b/ruby/lib/lago_ruby/models/webhook_endpoint_object.rb index 8adff81..47579f6 100644 --- a/ruby/lib/lago_ruby/models/webhook_endpoint_object.rb +++ b/ruby/lib/lago_ruby/models/webhook_endpoint_object.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/webhook_endpoint_update_input.rb b/ruby/lib/lago_ruby/models/webhook_endpoint_update_input.rb index fee37be..ef4895d 100644 --- a/ruby/lib/lago_ruby/models/webhook_endpoint_update_input.rb +++ b/ruby/lib/lago_ruby/models/webhook_endpoint_update_input.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/models/webhook_endpoints_paginated.rb b/ruby/lib/lago_ruby/models/webhook_endpoints_paginated.rb index 87c02ac..0f56375 100644 --- a/ruby/lib/lago_ruby/models/webhook_endpoints_paginated.rb +++ b/ruby/lib/lago_ruby/models/webhook_endpoints_paginated.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end diff --git a/ruby/lib/lago_ruby/version.rb b/ruby/lib/lago_ruby/version.rb index e4e994b..7f53c43 100644 --- a/ruby/lib/lago_ruby/version.rb +++ b/ruby/lib/lago_ruby/version.rb @@ -3,13 +3,13 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end module LagoAPI - VERSION = '0.52.0-beta' + VERSION = '0.56.0-beta' end diff --git a/ruby/spec/models/customer_charge_grouped_usage_object_inner_spec.rb b/ruby/spec/models/customer_charge_grouped_usage_object_inner_spec.rb new file mode 100644 index 0000000..4f097d4 --- /dev/null +++ b/ruby/spec/models/customer_charge_grouped_usage_object_inner_spec.rb @@ -0,0 +1,60 @@ +=begin +#Lago API documentation + +#Lago API allows your application to push customer information and metrics (events) from your application to the billing application. + +The version of the OpenAPI document: 0.53.0-beta +Contact: tech@getlago.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.4.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for LagoAPI::CustomerChargeGroupedUsageObjectInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe LagoAPI::CustomerChargeGroupedUsageObjectInner do + let(:instance) { LagoAPI::CustomerChargeGroupedUsageObjectInner.new } + + describe 'test an instance of CustomerChargeGroupedUsageObjectInner' do + it 'should create an instance of CustomerChargeGroupedUsageObjectInner' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(LagoAPI::CustomerChargeGroupedUsageObjectInner) + end + end + + describe 'test attribute "amount_cents"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "events_count"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "units"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "grouped_by"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "groups"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/ruby/spec/models/customer_charge_groups_usage_object_inner_spec.rb b/ruby/spec/models/customer_charge_groups_usage_object_inner_spec.rb new file mode 100644 index 0000000..3e204b2 --- /dev/null +++ b/ruby/spec/models/customer_charge_groups_usage_object_inner_spec.rb @@ -0,0 +1,66 @@ +=begin +#Lago API documentation + +#Lago API allows your application to push customer information and metrics (events) from your application to the billing application. + +The version of the OpenAPI document: 0.53.0-beta +Contact: tech@getlago.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.4.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for LagoAPI::CustomerChargeGroupsUsageObjectInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe LagoAPI::CustomerChargeGroupsUsageObjectInner do + let(:instance) { LagoAPI::CustomerChargeGroupsUsageObjectInner.new } + + describe 'test an instance of CustomerChargeGroupsUsageObjectInner' do + it 'should create an instance of CustomerChargeGroupsUsageObjectInner' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(LagoAPI::CustomerChargeGroupsUsageObjectInner) + end + end + + describe 'test attribute "lago_id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "key"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "value"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "units"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "events_count"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "amount_cents"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/ruby/spec/models/fee_object_amount_details_all_of_graduated_percentage_ranges_inner_spec.rb b/ruby/spec/models/fee_object_amount_details_all_of_graduated_percentage_ranges_inner_spec.rb new file mode 100644 index 0000000..2ca4401 --- /dev/null +++ b/ruby/spec/models/fee_object_amount_details_all_of_graduated_percentage_ranges_inner_spec.rb @@ -0,0 +1,72 @@ +=begin +#Lago API documentation + +#Lago API allows your application to push customer information and metrics (events) from your application to the billing application. + +The version of the OpenAPI document: 0.53.0-beta +Contact: tech@getlago.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.4.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for LagoAPI::FeeObjectAmountDetailsAllOfGraduatedPercentageRangesInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe LagoAPI::FeeObjectAmountDetailsAllOfGraduatedPercentageRangesInner do + let(:instance) { LagoAPI::FeeObjectAmountDetailsAllOfGraduatedPercentageRangesInner.new } + + describe 'test an instance of FeeObjectAmountDetailsAllOfGraduatedPercentageRangesInner' do + it 'should create an instance of FeeObjectAmountDetailsAllOfGraduatedPercentageRangesInner' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(LagoAPI::FeeObjectAmountDetailsAllOfGraduatedPercentageRangesInner) + end + end + + describe 'test attribute "units"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "from_value"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "to_value"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "flat_unit_amount"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "rate"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "per_unit_total_amount"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "total_with_flat_amount"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/ruby/spec/models/fee_object_amount_details_all_of_graduated_ranges_inner_spec.rb b/ruby/spec/models/fee_object_amount_details_all_of_graduated_ranges_inner_spec.rb new file mode 100644 index 0000000..8d18c3a --- /dev/null +++ b/ruby/spec/models/fee_object_amount_details_all_of_graduated_ranges_inner_spec.rb @@ -0,0 +1,72 @@ +=begin +#Lago API documentation + +#Lago API allows your application to push customer information and metrics (events) from your application to the billing application. + +The version of the OpenAPI document: 0.53.0-beta +Contact: tech@getlago.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.4.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for LagoAPI::FeeObjectAmountDetailsAllOfGraduatedRangesInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe LagoAPI::FeeObjectAmountDetailsAllOfGraduatedRangesInner do + let(:instance) { LagoAPI::FeeObjectAmountDetailsAllOfGraduatedRangesInner.new } + + describe 'test an instance of FeeObjectAmountDetailsAllOfGraduatedRangesInner' do + it 'should create an instance of FeeObjectAmountDetailsAllOfGraduatedRangesInner' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(LagoAPI::FeeObjectAmountDetailsAllOfGraduatedRangesInner) + end + end + + describe 'test attribute "units"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "from_value"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "to_value"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "flat_unit_amount"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "per_unit_amount"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "per_unit_total_amount"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "total_with_flat_amount"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/ruby/spec/models/fee_object_amount_details_all_of_volume_ranges_inner_spec.rb b/ruby/spec/models/fee_object_amount_details_all_of_volume_ranges_inner_spec.rb new file mode 100644 index 0000000..bb45fdd --- /dev/null +++ b/ruby/spec/models/fee_object_amount_details_all_of_volume_ranges_inner_spec.rb @@ -0,0 +1,48 @@ +=begin +#Lago API documentation + +#Lago API allows your application to push customer information and metrics (events) from your application to the billing application. + +The version of the OpenAPI document: 0.53.0-beta +Contact: tech@getlago.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.4.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for LagoAPI::FeeObjectAmountDetailsAllOfVolumeRangesInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe LagoAPI::FeeObjectAmountDetailsAllOfVolumeRangesInner do + let(:instance) { LagoAPI::FeeObjectAmountDetailsAllOfVolumeRangesInner.new } + + describe 'test an instance of FeeObjectAmountDetailsAllOfVolumeRangesInner' do + it 'should create an instance of FeeObjectAmountDetailsAllOfVolumeRangesInner' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(LagoAPI::FeeObjectAmountDetailsAllOfVolumeRangesInner) + end + end + + describe 'test attribute "per_unit_amount"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "flat_unit_amount"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "per_unit_total_amount"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/ruby/spec/models/fee_object_amount_details_spec.rb b/ruby/spec/models/fee_object_amount_details_spec.rb new file mode 100644 index 0000000..b905a58 --- /dev/null +++ b/ruby/spec/models/fee_object_amount_details_spec.rb @@ -0,0 +1,120 @@ +=begin +#Lago API documentation + +#Lago API allows your application to push customer information and metrics (events) from your application to the billing application. + +The version of the OpenAPI document: 0.53.0-beta +Contact: tech@getlago.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.4.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for LagoAPI::FeeObjectAmountDetails +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe LagoAPI::FeeObjectAmountDetails do + let(:instance) { LagoAPI::FeeObjectAmountDetails.new } + + describe 'test an instance of FeeObjectAmountDetails' do + it 'should create an instance of FeeObjectAmountDetails' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(LagoAPI::FeeObjectAmountDetails) + end + end + + describe 'test attribute "graduated_ranges"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "graduated_percentage_ranges"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "free_units"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "paid_units"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "per_package_size"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "per_package_unit_amount"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "units"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "free_events"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "rate"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "per_unit_total_amount"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "paid_events"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "fixed_fee_unit_amount"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "fixed_fee_total_amount"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "min_max_adjustment_total_amount"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "volume_ranges"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/ruby/spec/models/generate_customer_checkout_url200_response_customer_spec.rb b/ruby/spec/models/generate_customer_checkout_url200_response_customer_spec.rb new file mode 100644 index 0000000..e408463 --- /dev/null +++ b/ruby/spec/models/generate_customer_checkout_url200_response_customer_spec.rb @@ -0,0 +1,54 @@ +=begin +#Lago API documentation + +#Lago API allows your application to push customer information and metrics (events) from your application to the billing application. + +The version of the OpenAPI document: 0.53.0-beta +Contact: tech@getlago.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.4.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for LagoAPI::GenerateCustomerCheckoutURL200ResponseCustomer +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe LagoAPI::GenerateCustomerCheckoutURL200ResponseCustomer do + let(:instance) { LagoAPI::GenerateCustomerCheckoutURL200ResponseCustomer.new } + + describe 'test an instance of GenerateCustomerCheckoutURL200ResponseCustomer' do + it 'should create an instance of GenerateCustomerCheckoutURL200ResponseCustomer' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(LagoAPI::GenerateCustomerCheckoutURL200ResponseCustomer) + end + end + + describe 'test attribute "lago_customer_id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "external_customer_id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "payment_provider"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "checkout_url"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/ruby/spec/models/invoice_collection_object_spec.rb b/ruby/spec/models/invoice_collection_object_spec.rb new file mode 100644 index 0000000..390d605 --- /dev/null +++ b/ruby/spec/models/invoice_collection_object_spec.rb @@ -0,0 +1,64 @@ +=begin +#Lago API documentation + +#Lago API allows your application to push customer information and metrics (events) from your application to the billing application. + +The version of the OpenAPI document: 0.53.0-beta +Contact: tech@getlago.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.4.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for LagoAPI::InvoiceCollectionObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe LagoAPI::InvoiceCollectionObject do + let(:instance) { LagoAPI::InvoiceCollectionObject.new } + + describe 'test an instance of InvoiceCollectionObject' do + it 'should create an instance of InvoiceCollectionObject' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(LagoAPI::InvoiceCollectionObject) + end + end + + describe 'test attribute "month"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "payment_status"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["pending", "succeeded", "failed"]) + # validator.allowable_values.each do |value| + # expect { instance.payment_status = value }.not_to raise_error + # end + end + end + + describe 'test attribute "invoices_count"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "amount_cents"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "currency"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/ruby/spec/models/invoice_collections_spec.rb b/ruby/spec/models/invoice_collections_spec.rb new file mode 100644 index 0000000..21e2976 --- /dev/null +++ b/ruby/spec/models/invoice_collections_spec.rb @@ -0,0 +1,36 @@ +=begin +#Lago API documentation + +#Lago API allows your application to push customer information and metrics (events) from your application to the billing application. + +The version of the OpenAPI document: 0.53.0-beta +Contact: tech@getlago.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.4.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for LagoAPI::InvoiceCollections +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe LagoAPI::InvoiceCollections do + let(:instance) { LagoAPI::InvoiceCollections.new } + + describe 'test an instance of InvoiceCollections' do + it 'should create an instance of InvoiceCollections' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(LagoAPI::InvoiceCollections) + end + end + + describe 'test attribute "invoice_collections"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/ruby/spec/models/wallet_create_input_wallet_recurring_transaction_rules_inner_spec.rb b/ruby/spec/models/wallet_create_input_wallet_recurring_transaction_rules_inner_spec.rb new file mode 100644 index 0000000..33e803e --- /dev/null +++ b/ruby/spec/models/wallet_create_input_wallet_recurring_transaction_rules_inner_spec.rb @@ -0,0 +1,56 @@ +=begin +#Lago API documentation + +#Lago API allows your application to push customer information and metrics (events) from your application to the billing application. + +The version of the OpenAPI document: 0.53.0-beta +Contact: tech@getlago.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.4.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for LagoAPI::WalletCreateInputWalletRecurringTransactionRulesInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe LagoAPI::WalletCreateInputWalletRecurringTransactionRulesInner do + let(:instance) { LagoAPI::WalletCreateInputWalletRecurringTransactionRulesInner.new } + + describe 'test an instance of WalletCreateInputWalletRecurringTransactionRulesInner' do + it 'should create an instance of WalletCreateInputWalletRecurringTransactionRulesInner' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(LagoAPI::WalletCreateInputWalletRecurringTransactionRulesInner) + end + end + + describe 'test attribute "rule_type"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["interval", "threshold"]) + # validator.allowable_values.each do |value| + # expect { instance.rule_type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "interval"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["weekly", "monthly", "quarterly", "yearly"]) + # validator.allowable_values.each do |value| + # expect { instance.interval = value }.not_to raise_error + # end + end + end + + describe 'test attribute "threshold_credits"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/ruby/spec/models/wallet_object_recurring_transaction_rules_inner_spec.rb b/ruby/spec/models/wallet_object_recurring_transaction_rules_inner_spec.rb new file mode 100644 index 0000000..73daa01 --- /dev/null +++ b/ruby/spec/models/wallet_object_recurring_transaction_rules_inner_spec.rb @@ -0,0 +1,80 @@ +=begin +#Lago API documentation + +#Lago API allows your application to push customer information and metrics (events) from your application to the billing application. + +The version of the OpenAPI document: 0.53.0-beta +Contact: tech@getlago.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.4.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for LagoAPI::WalletObjectRecurringTransactionRulesInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe LagoAPI::WalletObjectRecurringTransactionRulesInner do + let(:instance) { LagoAPI::WalletObjectRecurringTransactionRulesInner.new } + + describe 'test an instance of WalletObjectRecurringTransactionRulesInner' do + it 'should create an instance of WalletObjectRecurringTransactionRulesInner' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(LagoAPI::WalletObjectRecurringTransactionRulesInner) + end + end + + describe 'test attribute "lago_id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "rule_type"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["interval", "threshold"]) + # validator.allowable_values.each do |value| + # expect { instance.rule_type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "interval"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["weekly", "monthly", "quarterly", "yearly"]) + # validator.allowable_values.each do |value| + # expect { instance.interval = value }.not_to raise_error + # end + end + end + + describe 'test attribute "threshold_credits"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "paid_credits"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "granted_credits"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "created_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/ruby/spec/models/wallet_update_input_wallet_recurring_transaction_rules_inner_spec.rb b/ruby/spec/models/wallet_update_input_wallet_recurring_transaction_rules_inner_spec.rb new file mode 100644 index 0000000..5f52e6a --- /dev/null +++ b/ruby/spec/models/wallet_update_input_wallet_recurring_transaction_rules_inner_spec.rb @@ -0,0 +1,74 @@ +=begin +#Lago API documentation + +#Lago API allows your application to push customer information and metrics (events) from your application to the billing application. + +The version of the OpenAPI document: 0.53.0-beta +Contact: tech@getlago.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.4.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for LagoAPI::WalletUpdateInputWalletRecurringTransactionRulesInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe LagoAPI::WalletUpdateInputWalletRecurringTransactionRulesInner do + let(:instance) { LagoAPI::WalletUpdateInputWalletRecurringTransactionRulesInner.new } + + describe 'test an instance of WalletUpdateInputWalletRecurringTransactionRulesInner' do + it 'should create an instance of WalletUpdateInputWalletRecurringTransactionRulesInner' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(LagoAPI::WalletUpdateInputWalletRecurringTransactionRulesInner) + end + end + + describe 'test attribute "lago_id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "rule_type"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["interval", "threshold"]) + # validator.allowable_values.each do |value| + # expect { instance.rule_type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "interval"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["weekly", "monthly", "quarterly", "yearly"]) + # validator.allowable_values.each do |value| + # expect { instance.interval = value }.not_to raise_error + # end + end + end + + describe 'test attribute "threshold_credits"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "paid_credits"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "granted_credits"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/ruby/spec/spec_helper.rb b/ruby/spec/spec_helper.rb index b2539ec..238e6e4 100644 --- a/ruby/spec/spec_helper.rb +++ b/ruby/spec/spec_helper.rb @@ -3,10 +3,10 @@ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application. -The version of the OpenAPI document: 0.51.0-beta +The version of the OpenAPI document: 0.53.0-beta Contact: tech@getlago.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.2.0-SNAPSHOT +OpenAPI Generator version: 7.4.0-SNAPSHOT =end