lago_ruby 0.46.0.pre.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CODE_OF_CONDUCT.md +128 -0
- data/CONTRIBUTING.md +213 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +72 -0
- data/LICENSE +21 -0
- data/README.md +343 -0
- data/Rakefile +10 -0
- data/docs/AddOn.md +18 -0
- data/docs/AddOnBaseInput.md +28 -0
- data/docs/AddOnCreateInput.md +18 -0
- data/docs/AddOnCreateInputAddOn.md +28 -0
- data/docs/AddOnObject.md +32 -0
- data/docs/AddOnUpdateInput.md +18 -0
- data/docs/AddOnsApi.md +433 -0
- data/docs/AddOnsPaginated.md +20 -0
- data/docs/ApiErrorBadRequest.md +20 -0
- data/docs/ApiErrorForbidden.md +22 -0
- data/docs/ApiErrorNotAllowed.md +22 -0
- data/docs/ApiErrorNotFound.md +22 -0
- data/docs/ApiErrorUnauthorized.md +20 -0
- data/docs/ApiErrorUnprocessableEntity.md +24 -0
- data/docs/AppliedAddOn.md +18 -0
- data/docs/AppliedAddOnInput.md +18 -0
- data/docs/AppliedAddOnInputAppliedAddOn.md +24 -0
- data/docs/AppliedAddOnObject.md +32 -0
- data/docs/AppliedCoupon.md +18 -0
- data/docs/AppliedCouponInput.md +18 -0
- data/docs/AppliedCouponInputAppliedCoupon.md +30 -0
- data/docs/AppliedCouponObject.md +50 -0
- data/docs/AppliedCouponObjectExtended.md +52 -0
- data/docs/AppliedCouponsPaginated.md +20 -0
- data/docs/BaseAppliedTax.md +34 -0
- data/docs/BillableMetric.md +18 -0
- data/docs/BillableMetricBaseInput.md +30 -0
- data/docs/BillableMetricCreateInput.md +18 -0
- data/docs/BillableMetricCreateInputBillableMetric.md +30 -0
- data/docs/BillableMetricGroup.md +20 -0
- data/docs/BillableMetricGroupValuesInner.md +49 -0
- data/docs/BillableMetricGroupValuesInnerOneOf.md +20 -0
- data/docs/BillableMetricObject.md +40 -0
- data/docs/BillableMetricUpdateInput.md +18 -0
- data/docs/BillableMetricsApi.md +439 -0
- data/docs/BillableMetricsPaginated.md +20 -0
- data/docs/ChargeObject.md +40 -0
- data/docs/ChargeObjectProperties.md +40 -0
- data/docs/ChargeProperties.md +40 -0
- data/docs/ChargePropertiesGraduatedPercentageRangesInner.md +24 -0
- data/docs/ChargePropertiesGraduatedRangesInner.md +24 -0
- data/docs/ChargePropertiesVolumeRangesInner.md +24 -0
- data/docs/Country.md +15 -0
- data/docs/Coupon.md +18 -0
- data/docs/CouponBaseInput.md +42 -0
- data/docs/CouponBaseInputAppliesTo.md +20 -0
- data/docs/CouponCreateInput.md +18 -0
- data/docs/CouponCreateInputCoupon.md +42 -0
- data/docs/CouponObject.md +52 -0
- data/docs/CouponUpdateInput.md +18 -0
- data/docs/CouponsApi.md +583 -0
- data/docs/CouponsPaginated.md +20 -0
- data/docs/CreateWebhookEndpoint200Response.md +18 -0
- data/docs/CreateWebhookEndpoint200ResponseWebhookEndpoint.md +26 -0
- data/docs/CreateWebhookEndpointRequest.md +18 -0
- data/docs/CreateWebhookEndpointRequestWebhookEndpoint.md +20 -0
- data/docs/CreditNote.md +18 -0
- data/docs/CreditNoteAppliedTaxObject.md +38 -0
- data/docs/CreditNoteCreateInput.md +18 -0
- data/docs/CreditNoteCreateInputCreditNote.md +28 -0
- data/docs/CreditNoteCreateInputCreditNoteItemsInner.md +20 -0
- data/docs/CreditNoteItemObject.md +24 -0
- data/docs/CreditNoteItemObjectFee.md +74 -0
- data/docs/CreditNoteObject.md +64 -0
- data/docs/CreditNoteUpdateInput.md +18 -0
- data/docs/CreditNoteUpdateInputCreditNote.md +18 -0
- data/docs/CreditNotes.md +18 -0
- data/docs/CreditNotesApi.md +435 -0
- data/docs/CreditObject.md +28 -0
- data/docs/CreditObjectInvoice.md +20 -0
- data/docs/CreditObjectItem.md +24 -0
- data/docs/Currency.md +15 -0
- data/docs/Customer.md +18 -0
- data/docs/CustomerBillingConfiguration.md +30 -0
- data/docs/CustomerChargeUsageObject.md +28 -0
- data/docs/CustomerChargeUsageObjectBillableMetric.md +24 -0
- data/docs/CustomerChargeUsageObjectCharge.md +20 -0
- data/docs/CustomerChargeUsageObjectGroupsInner.md +26 -0
- data/docs/CustomerCreateInput.md +18 -0
- data/docs/CustomerCreateInputCustomer.md +58 -0
- data/docs/CustomerCreateInputCustomerMetadataInner.md +24 -0
- data/docs/CustomerMetadata.md +26 -0
- data/docs/CustomerObject.md +68 -0
- data/docs/CustomerObjectExtended.md +70 -0
- data/docs/CustomerUsage.md +18 -0
- data/docs/CustomerUsageObject.md +32 -0
- data/docs/CustomersApi.md +505 -0
- data/docs/CustomersPaginated.md +20 -0
- data/docs/Event.md +18 -0
- data/docs/EventBatchInput.md +18 -0
- data/docs/EventBatchInputEvent.md +28 -0
- data/docs/EventBatchInputEventProperties.md +18 -0
- data/docs/EventEstimateFeesInput.md +18 -0
- data/docs/EventEstimateFeesInputEvent.md +24 -0
- data/docs/EventInput.md +18 -0
- data/docs/EventInputEvent.md +28 -0
- data/docs/EventObject.md +36 -0
- data/docs/EventsApi.md +285 -0
- data/docs/Fee.md +18 -0
- data/docs/FeeAppliedTaxObject.md +36 -0
- data/docs/FeeObject.md +74 -0
- data/docs/FeeObjectItem.md +26 -0
- data/docs/FeeUpdateInput.md +18 -0
- data/docs/FeeUpdateInputFee.md +18 -0
- data/docs/Fees.md +18 -0
- data/docs/FeesApi.md +253 -0
- data/docs/FeesPaginated.md +20 -0
- data/docs/FindAllWebhookEndpoints200Response.md +20 -0
- data/docs/GetCustomerPortalUrl200Response.md +18 -0
- data/docs/GetCustomerPortalUrl200ResponseCustomer.md +18 -0
- data/docs/GroupObject.md +22 -0
- data/docs/GroupPropertiesObject.md +20 -0
- data/docs/GroupPropertiesObjectValues.md +40 -0
- data/docs/GroupsPaginated.md +20 -0
- data/docs/Invoice.md +18 -0
- data/docs/InvoiceAppliedTaxObject.md +38 -0
- data/docs/InvoiceMetadataObject.md +24 -0
- data/docs/InvoiceObject.md +62 -0
- data/docs/InvoiceObjectCustomer.md +68 -0
- data/docs/InvoiceObjectExtended.md +68 -0
- data/docs/InvoiceOneOffCreateInput.md +18 -0
- data/docs/InvoiceOneOffCreateInputInvoice.md +22 -0
- data/docs/InvoiceOneOffCreateInputInvoiceFeesInner.md +26 -0
- data/docs/InvoiceUpdateInput.md +18 -0
- data/docs/InvoiceUpdateInputInvoice.md +20 -0
- data/docs/InvoiceUpdateInputInvoiceMetadataInner.md +22 -0
- data/docs/InvoicesApi.md +582 -0
- data/docs/InvoicesPaginated.md +20 -0
- data/docs/Organization.md +18 -0
- data/docs/OrganizationBillingConfiguration.md +22 -0
- data/docs/OrganizationObject.md +54 -0
- data/docs/OrganizationUpdateInput.md +18 -0
- data/docs/OrganizationUpdateInputOrganization.md +46 -0
- data/docs/OrganizationsApi.md +77 -0
- data/docs/PaginationMeta.md +26 -0
- data/docs/Plan.md +18 -0
- data/docs/PlanCreateInput.md +18 -0
- data/docs/PlanCreateInputPlan.md +38 -0
- data/docs/PlanCreateInputPlanChargesInner.md +34 -0
- data/docs/PlanCreateInputPlanChargesInnerGroupPropertiesInner.md +20 -0
- data/docs/PlanObject.md +46 -0
- data/docs/PlanUpdateInput.md +18 -0
- data/docs/PlanUpdateInputPlan.md +38 -0
- data/docs/PlanUpdateInputPlanChargesInner.md +36 -0
- data/docs/PlansApi.md +363 -0
- data/docs/PlansPaginated.md +20 -0
- data/docs/Subscription.md +18 -0
- data/docs/SubscriptionCreateInput.md +18 -0
- data/docs/SubscriptionCreateInputSubscription.md +28 -0
- data/docs/SubscriptionObject.md +48 -0
- data/docs/SubscriptionUpdateInput.md +18 -0
- data/docs/SubscriptionUpdateInputSubscription.md +20 -0
- data/docs/SubscriptionsApi.md +303 -0
- data/docs/SubscriptionsPaginated.md +20 -0
- data/docs/Tax.md +18 -0
- data/docs/TaxBaseInput.md +26 -0
- data/docs/TaxCreateInput.md +18 -0
- data/docs/TaxCreateInputTax.md +26 -0
- data/docs/TaxObject.md +38 -0
- data/docs/TaxUpdateInput.md +18 -0
- data/docs/TaxesApi.md +363 -0
- data/docs/TaxesPaginated.md +20 -0
- data/docs/Timezone.md +15 -0
- data/docs/Wallet.md +18 -0
- data/docs/WalletCreateInput.md +18 -0
- data/docs/WalletCreateInputWallet.md +30 -0
- data/docs/WalletObject.md +46 -0
- data/docs/WalletTransactionCreateInput.md +18 -0
- data/docs/WalletTransactionCreateInputWalletTransaction.md +22 -0
- data/docs/WalletTransactionObject.md +32 -0
- data/docs/WalletTransactions.md +18 -0
- data/docs/WalletTransactionsPaginated.md +20 -0
- data/docs/WalletUpdateInput.md +18 -0
- data/docs/WalletUpdateInputWallet.md +20 -0
- data/docs/WalletsApi.md +515 -0
- data/docs/WalletsPaginated.md +20 -0
- data/docs/WebhookEndpointsApi.md +363 -0
- data/docs/WebhooksApi.md +74 -0
- data/git_push.sh +57 -0
- data/lago_ruby.gemspec +42 -0
- data/lib/lago_ruby/api/add_ons_api.rb +421 -0
- data/lib/lago_ruby/api/billable_metrics_api.rb +422 -0
- data/lib/lago_ruby/api/coupons_api.rb +563 -0
- data/lib/lago_ruby/api/credit_notes_api.rb +419 -0
- data/lib/lago_ruby/api/customers_api.rb +481 -0
- data/lib/lago_ruby/api/events_api.rb +289 -0
- data/lib/lago_ruby/api/fees_api.rb +268 -0
- data/lib/lago_ruby/api/invoices_api.rb +565 -0
- data/lib/lago_ruby/api/organizations_api.rb +90 -0
- data/lib/lago_ruby/api/plans_api.rb +353 -0
- data/lib/lago_ruby/api/subscriptions_api.rb +306 -0
- data/lib/lago_ruby/api/taxes_api.rb +353 -0
- data/lib/lago_ruby/api/wallets_api.rb +503 -0
- data/lib/lago_ruby/api/webhook_endpoints_api.rb +353 -0
- data/lib/lago_ruby/api/webhooks_api.rb +79 -0
- data/lib/lago_ruby/api_client.rb +392 -0
- data/lib/lago_ruby/api_error.rb +58 -0
- data/lib/lago_ruby/configuration.rb +297 -0
- data/lib/lago_ruby/models/add_on.rb +221 -0
- data/lib/lago_ruby/models/add_on_base_input.rb +267 -0
- data/lib/lago_ruby/models/add_on_create_input.rb +221 -0
- data/lib/lago_ruby/models/add_on_create_input_add_on.rb +302 -0
- data/lib/lago_ruby/models/add_on_object.rb +329 -0
- data/lib/lago_ruby/models/add_on_update_input.rb +221 -0
- data/lib/lago_ruby/models/add_ons_paginated.rb +239 -0
- data/lib/lago_ruby/models/api_error_bad_request.rb +237 -0
- data/lib/lago_ruby/models/api_error_forbidden.rb +253 -0
- data/lib/lago_ruby/models/api_error_not_allowed.rb +253 -0
- data/lib/lago_ruby/models/api_error_not_found.rb +253 -0
- data/lib/lago_ruby/models/api_error_unauthorized.rb +237 -0
- data/lib/lago_ruby/models/api_error_unprocessable_entity.rb +269 -0
- data/lib/lago_ruby/models/applied_add_on.rb +221 -0
- data/lib/lago_ruby/models/applied_add_on_input.rb +221 -0
- data/lib/lago_ruby/models/applied_add_on_input_applied_add_on.rb +259 -0
- data/lib/lago_ruby/models/applied_add_on_object.rb +339 -0
- data/lib/lago_ruby/models/applied_coupon.rb +221 -0
- data/lib/lago_ruby/models/applied_coupon_input.rb +221 -0
- data/lib/lago_ruby/models/applied_coupon_input_applied_coupon.rb +343 -0
- data/lib/lago_ruby/models/applied_coupon_object.rb +507 -0
- data/lib/lago_ruby/models/applied_coupon_object_extended.rb +532 -0
- data/lib/lago_ruby/models/applied_coupons_paginated.rb +239 -0
- data/lib/lago_ruby/models/base_applied_tax.rb +294 -0
- data/lib/lago_ruby/models/billable_metric.rb +221 -0
- data/lib/lago_ruby/models/billable_metric_base_input.rb +310 -0
- data/lib/lago_ruby/models/billable_metric_create_input.rb +221 -0
- data/lib/lago_ruby/models/billable_metric_create_input_billable_metric.rb +338 -0
- data/lib/lago_ruby/models/billable_metric_group.rb +242 -0
- data/lib/lago_ruby/models/billable_metric_group_values_inner.rb +105 -0
- data/lib/lago_ruby/models/billable_metric_group_values_inner_one_of.rb +242 -0
- data/lib/lago_ruby/models/billable_metric_object.rb +423 -0
- data/lib/lago_ruby/models/billable_metric_update_input.rb +221 -0
- data/lib/lago_ruby/models/billable_metrics_paginated.rb +239 -0
- data/lib/lago_ruby/models/charge_object.rb +397 -0
- data/lib/lago_ruby/models/charge_object_properties.rb +422 -0
- data/lib/lago_ruby/models/charge_properties.rb +415 -0
- data/lib/lago_ruby/models/charge_properties_graduated_percentage_ranges_inner.rb +269 -0
- data/lib/lago_ruby/models/charge_properties_graduated_ranges_inner.rb +311 -0
- data/lib/lago_ruby/models/charge_properties_volume_ranges_inner.rb +311 -0
- data/lib/lago_ruby/models/country.rb +287 -0
- data/lib/lago_ruby/models/coupon.rb +221 -0
- data/lib/lago_ruby/models/coupon_base_input.rb +414 -0
- data/lib/lago_ruby/models/coupon_base_input_applies_to.rb +232 -0
- data/lib/lago_ruby/models/coupon_create_input.rb +221 -0
- data/lib/lago_ruby/models/coupon_create_input_coupon.rb +449 -0
- data/lib/lago_ruby/models/coupon_object.rb +538 -0
- data/lib/lago_ruby/models/coupon_update_input.rb +221 -0
- data/lib/lago_ruby/models/coupons_paginated.rb +239 -0
- data/lib/lago_ruby/models/create_webhook_endpoint200_response.rb +221 -0
- data/lib/lago_ruby/models/create_webhook_endpoint200_response_webhook_endpoint.rb +317 -0
- data/lib/lago_ruby/models/create_webhook_endpoint_request.rb +214 -0
- data/lib/lago_ruby/models/create_webhook_endpoint_request_webhook_endpoint.rb +267 -0
- data/lib/lago_ruby/models/credit_note.rb +221 -0
- data/lib/lago_ruby/models/credit_note_applied_tax_object.rb +320 -0
- data/lib/lago_ruby/models/credit_note_create_input.rb +221 -0
- data/lib/lago_ruby/models/credit_note_create_input_credit_note.rb +318 -0
- data/lib/lago_ruby/models/credit_note_create_input_credit_note_items_inner.rb +239 -0
- data/lib/lago_ruby/models/credit_note_item_object.rb +271 -0
- data/lib/lago_ruby/models/credit_note_item_object_fee.rb +628 -0
- data/lib/lago_ruby/models/credit_note_object.rb +635 -0
- data/lib/lago_ruby/models/credit_note_update_input.rb +221 -0
- data/lib/lago_ruby/models/credit_note_update_input_credit_note.rb +256 -0
- data/lib/lago_ruby/models/credit_notes.rb +223 -0
- data/lib/lago_ruby/models/credit_object.rb +304 -0
- data/lib/lago_ruby/models/credit_object_invoice.rb +271 -0
- data/lib/lago_ruby/models/credit_object_item.rb +308 -0
- data/lib/lago_ruby/models/currency.rb +175 -0
- data/lib/lago_ruby/models/customer.rb +221 -0
- data/lib/lago_ruby/models/customer_billing_configuration.rb +313 -0
- data/lib/lago_ruby/models/customer_charge_usage_object.rb +327 -0
- data/lib/lago_ruby/models/customer_charge_usage_object_billable_metric.rb +308 -0
- data/lib/lago_ruby/models/customer_charge_usage_object_charge.rb +274 -0
- data/lib/lago_ruby/models/customer_charge_usage_object_groups_inner.rb +277 -0
- data/lib/lago_ruby/models/customer_create_input.rb +221 -0
- data/lib/lago_ruby/models/customer_create_input_customer.rb +436 -0
- data/lib/lago_ruby/models/customer_create_input_customer_metadata_inner.rb +266 -0
- data/lib/lago_ruby/models/customer_metadata.rb +291 -0
- data/lib/lago_ruby/models/customer_object.rb +517 -0
- data/lib/lago_ruby/models/customer_object_extended.rb +536 -0
- data/lib/lago_ruby/models/customer_usage.rb +221 -0
- data/lib/lago_ruby/models/customer_usage_object.rb +335 -0
- data/lib/lago_ruby/models/customers_paginated.rb +239 -0
- data/lib/lago_ruby/models/event.rb +221 -0
- data/lib/lago_ruby/models/event_batch_input.rb +221 -0
- data/lib/lago_ruby/models/event_batch_input_event.rb +287 -0
- data/lib/lago_ruby/models/event_batch_input_event_properties.rb +250 -0
- data/lib/lago_ruby/models/event_estimate_fees_input.rb +221 -0
- data/lib/lago_ruby/models/event_estimate_fees_input_event.rb +252 -0
- data/lib/lago_ruby/models/event_input.rb +221 -0
- data/lib/lago_ruby/models/event_input_event.rb +278 -0
- data/lib/lago_ruby/models/event_object.rb +367 -0
- data/lib/lago_ruby/models/fee.rb +221 -0
- data/lib/lago_ruby/models/fee_applied_tax_object.rb +311 -0
- data/lib/lago_ruby/models/fee_object.rb +621 -0
- data/lib/lago_ruby/models/fee_object_item.rb +337 -0
- data/lib/lago_ruby/models/fee_update_input.rb +221 -0
- data/lib/lago_ruby/models/fee_update_input_fee.rb +256 -0
- data/lib/lago_ruby/models/fees.rb +223 -0
- data/lib/lago_ruby/models/fees_paginated.rb +246 -0
- data/lib/lago_ruby/models/find_all_webhook_endpoints200_response.rb +239 -0
- data/lib/lago_ruby/models/get_customer_portal_url200_response.rb +221 -0
- data/lib/lago_ruby/models/get_customer_portal_url200_response_customer.rb +222 -0
- data/lib/lago_ruby/models/group_object.rb +256 -0
- data/lib/lago_ruby/models/group_properties_object.rb +238 -0
- data/lib/lago_ruby/models/group_properties_object_values.rb +422 -0
- data/lib/lago_ruby/models/groups_paginated.rb +239 -0
- data/lib/lago_ruby/models/invoice.rb +221 -0
- data/lib/lago_ruby/models/invoice_applied_tax_object.rb +321 -0
- data/lib/lago_ruby/models/invoice_metadata_object.rb +245 -0
- data/lib/lago_ruby/models/invoice_object.rb +611 -0
- data/lib/lago_ruby/models/invoice_object_customer.rb +524 -0
- data/lib/lago_ruby/models/invoice_object_extended.rb +651 -0
- data/lib/lago_ruby/models/invoice_one_off_create_input.rb +221 -0
- data/lib/lago_ruby/models/invoice_one_off_create_input_invoice.rb +249 -0
- data/lib/lago_ruby/models/invoice_one_off_create_input_invoice_fees_inner.rb +284 -0
- data/lib/lago_ruby/models/invoice_update_input.rb +221 -0
- data/lib/lago_ruby/models/invoice_update_input_invoice.rb +260 -0
- data/lib/lago_ruby/models/invoice_update_input_invoice_metadata_inner.rb +235 -0
- data/lib/lago_ruby/models/invoices_paginated.rb +239 -0
- data/lib/lago_ruby/models/organization.rb +221 -0
- data/lib/lago_ruby/models/organization_billing_configuration.rb +237 -0
- data/lib/lago_ruby/models/organization_object.rb +431 -0
- data/lib/lago_ruby/models/organization_update_input.rb +221 -0
- data/lib/lago_ruby/models/organization_update_input_organization.rb +386 -0
- data/lib/lago_ruby/models/pagination_meta.rb +278 -0
- data/lib/lago_ruby/models/plan.rb +221 -0
- data/lib/lago_ruby/models/plan_create_input.rb +221 -0
- data/lib/lago_ruby/models/plan_create_input_plan.rb +353 -0
- data/lib/lago_ruby/models/plan_create_input_plan_charges_inner.rb +332 -0
- data/lib/lago_ruby/models/plan_create_input_plan_charges_inner_group_properties_inner.rb +238 -0
- data/lib/lago_ruby/models/plan_object.rb +456 -0
- data/lib/lago_ruby/models/plan_update_input.rb +221 -0
- data/lib/lago_ruby/models/plan_update_input_plan.rb +353 -0
- data/lib/lago_ruby/models/plan_update_input_plan_charges_inner.rb +342 -0
- data/lib/lago_ruby/models/plans_paginated.rb +239 -0
- data/lib/lago_ruby/models/subscription.rb +221 -0
- data/lib/lago_ruby/models/subscription_create_input.rb +221 -0
- data/lib/lago_ruby/models/subscription_create_input_subscription.rb +320 -0
- data/lib/lago_ruby/models/subscription_object.rb +481 -0
- data/lib/lago_ruby/models/subscription_update_input.rb +221 -0
- data/lib/lago_ruby/models/subscription_update_input_subscription.rb +226 -0
- data/lib/lago_ruby/models/subscriptions_paginated.rb +239 -0
- data/lib/lago_ruby/models/tax.rb +221 -0
- data/lib/lago_ruby/models/tax_base_input.rb +277 -0
- data/lib/lago_ruby/models/tax_create_input.rb +221 -0
- data/lib/lago_ruby/models/tax_create_input_tax.rb +305 -0
- data/lib/lago_ruby/models/tax_object.rb +364 -0
- data/lib/lago_ruby/models/tax_update_input.rb +221 -0
- data/lib/lago_ruby/models/taxes_paginated.rb +239 -0
- data/lib/lago_ruby/models/timezone.rb +173 -0
- data/lib/lago_ruby/models/wallet.rb +221 -0
- data/lib/lago_ruby/models/wallet_create_input.rb +214 -0
- data/lib/lago_ruby/models/wallet_create_input_wallet.rb +353 -0
- data/lib/lago_ruby/models/wallet_object.rb +525 -0
- data/lib/lago_ruby/models/wallet_transaction_create_input.rb +221 -0
- data/lib/lago_ruby/models/wallet_transaction_create_input_wallet_transaction.rb +284 -0
- data/lib/lago_ruby/models/wallet_transaction_object.rb +422 -0
- data/lib/lago_ruby/models/wallet_transactions.rb +223 -0
- data/lib/lago_ruby/models/wallet_transactions_paginated.rb +246 -0
- data/lib/lago_ruby/models/wallet_update_input.rb +221 -0
- data/lib/lago_ruby/models/wallet_update_input_wallet.rb +227 -0
- data/lib/lago_ruby/models/wallets_paginated.rb +239 -0
- data/lib/lago_ruby/version.rb +15 -0
- data/lib/lago_ruby.rb +217 -0
- data/spec/api/add_ons_api_spec.rb +109 -0
- data/spec/api/billable_metrics_api_spec.rb +111 -0
- data/spec/api/coupons_api_spec.rb +137 -0
- data/spec/api/credit_notes_api_spec.rb +110 -0
- data/spec/api/customers_api_spec.rb +122 -0
- data/spec/api/events_api_spec.rb +83 -0
- data/spec/api/fees_api_spec.rb +87 -0
- data/spec/api/invoices_api_spec.rb +138 -0
- data/spec/api/organizations_api_spec.rb +47 -0
- data/spec/api/plans_api_spec.rb +97 -0
- data/spec/api/subscriptions_api_spec.rb +89 -0
- data/spec/api/taxes_api_spec.rb +97 -0
- data/spec/api/wallets_api_spec.rb +126 -0
- data/spec/api/webhook_endpoints_api_spec.rb +97 -0
- data/spec/api/webhooks_api_spec.rb +46 -0
- data/spec/api_client_spec.rb +228 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/add_on_base_input_spec.rb +64 -0
- data/spec/models/add_on_create_input_add_on_spec.rb +64 -0
- data/spec/models/add_on_create_input_spec.rb +34 -0
- data/spec/models/add_on_object_spec.rb +76 -0
- data/spec/models/add_on_spec.rb +34 -0
- data/spec/models/add_on_update_input_spec.rb +34 -0
- data/spec/models/add_ons_paginated_spec.rb +40 -0
- data/spec/models/api_error_bad_request_spec.rb +40 -0
- data/spec/models/api_error_forbidden_spec.rb +46 -0
- data/spec/models/api_error_not_allowed_spec.rb +46 -0
- data/spec/models/api_error_not_found_spec.rb +46 -0
- data/spec/models/api_error_unauthorized_spec.rb +40 -0
- data/spec/models/api_error_unprocessable_entity_spec.rb +52 -0
- data/spec/models/applied_add_on_input_applied_add_on_spec.rb +52 -0
- data/spec/models/applied_add_on_input_spec.rb +34 -0
- data/spec/models/applied_add_on_object_spec.rb +76 -0
- data/spec/models/applied_add_on_spec.rb +34 -0
- data/spec/models/applied_coupon_input_applied_coupon_spec.rb +74 -0
- data/spec/models/applied_coupon_input_spec.rb +34 -0
- data/spec/models/applied_coupon_object_extended_spec.rb +144 -0
- data/spec/models/applied_coupon_object_spec.rb +138 -0
- data/spec/models/applied_coupon_spec.rb +34 -0
- data/spec/models/applied_coupons_paginated_spec.rb +40 -0
- data/spec/models/base_applied_tax_spec.rb +82 -0
- data/spec/models/billable_metric_base_input_spec.rb +74 -0
- data/spec/models/billable_metric_create_input_billable_metric_spec.rb +74 -0
- data/spec/models/billable_metric_create_input_spec.rb +34 -0
- data/spec/models/billable_metric_group_spec.rb +40 -0
- data/spec/models/billable_metric_group_values_inner_one_of_spec.rb +40 -0
- data/spec/models/billable_metric_group_values_inner_spec.rb +31 -0
- data/spec/models/billable_metric_object_spec.rb +104 -0
- data/spec/models/billable_metric_spec.rb +34 -0
- data/spec/models/billable_metric_update_input_spec.rb +34 -0
- data/spec/models/billable_metrics_paginated_spec.rb +40 -0
- data/spec/models/charge_object_properties_spec.rb +100 -0
- data/spec/models/charge_object_spec.rb +104 -0
- data/spec/models/charge_properties_graduated_percentage_ranges_inner_spec.rb +52 -0
- data/spec/models/charge_properties_graduated_ranges_inner_spec.rb +59 -0
- data/spec/models/charge_properties_spec.rb +100 -0
- data/spec/models/charge_properties_volume_ranges_inner_spec.rb +59 -0
- data/spec/models/country_spec.rb +28 -0
- data/spec/models/coupon_base_input_applies_to_spec.rb +40 -0
- data/spec/models/coupon_base_input_spec.rb +118 -0
- data/spec/models/coupon_create_input_coupon_spec.rb +118 -0
- data/spec/models/coupon_create_input_spec.rb +34 -0
- data/spec/models/coupon_object_spec.rb +148 -0
- data/spec/models/coupon_spec.rb +34 -0
- data/spec/models/coupon_update_input_spec.rb +34 -0
- data/spec/models/coupons_paginated_spec.rb +40 -0
- data/spec/models/create_webhook_endpoint200_response_spec.rb +34 -0
- data/spec/models/create_webhook_endpoint200_response_webhook_endpoint_spec.rb +62 -0
- data/spec/models/create_webhook_endpoint_request_spec.rb +34 -0
- data/spec/models/create_webhook_endpoint_request_webhook_endpoint_spec.rb +44 -0
- data/spec/models/credit_note_applied_tax_object_spec.rb +94 -0
- data/spec/models/credit_note_create_input_credit_note_items_inner_spec.rb +40 -0
- data/spec/models/credit_note_create_input_credit_note_spec.rb +68 -0
- data/spec/models/credit_note_create_input_spec.rb +34 -0
- data/spec/models/credit_note_item_object_fee_spec.rb +206 -0
- data/spec/models/credit_note_item_object_spec.rb +52 -0
- data/spec/models/credit_note_object_spec.rb +184 -0
- data/spec/models/credit_note_spec.rb +34 -0
- data/spec/models/credit_note_update_input_credit_note_spec.rb +38 -0
- data/spec/models/credit_note_update_input_spec.rb +34 -0
- data/spec/models/credit_notes_spec.rb +34 -0
- data/spec/models/credit_object_invoice_spec.rb +44 -0
- data/spec/models/credit_object_item_spec.rb +56 -0
- data/spec/models/credit_object_spec.rb +64 -0
- data/spec/models/currency_spec.rb +28 -0
- data/spec/models/customer_billing_configuration_spec.rb +74 -0
- data/spec/models/customer_charge_usage_object_billable_metric_spec.rb +56 -0
- data/spec/models/customer_charge_usage_object_charge_spec.rb +44 -0
- data/spec/models/customer_charge_usage_object_groups_inner_spec.rb +58 -0
- data/spec/models/customer_charge_usage_object_spec.rb +89 -0
- data/spec/models/customer_create_input_customer_metadata_inner_spec.rb +52 -0
- data/spec/models/customer_create_input_customer_spec.rb +154 -0
- data/spec/models/customer_create_input_spec.rb +34 -0
- data/spec/models/customer_metadata_spec.rb +58 -0
- data/spec/models/customer_object_extended_spec.rb +190 -0
- data/spec/models/customer_object_spec.rb +184 -0
- data/spec/models/customer_spec.rb +34 -0
- data/spec/models/customer_usage_object_spec.rb +76 -0
- data/spec/models/customer_usage_spec.rb +34 -0
- data/spec/models/customers_paginated_spec.rb +40 -0
- data/spec/models/event_batch_input_event_properties_spec.rb +38 -0
- data/spec/models/event_batch_input_event_spec.rb +64 -0
- data/spec/models/event_batch_input_spec.rb +34 -0
- data/spec/models/event_estimate_fees_input_event_spec.rb +52 -0
- data/spec/models/event_estimate_fees_input_spec.rb +34 -0
- data/spec/models/event_input_event_spec.rb +64 -0
- data/spec/models/event_input_spec.rb +34 -0
- data/spec/models/event_object_spec.rb +88 -0
- data/spec/models/event_spec.rb +34 -0
- data/spec/models/fee_applied_tax_object_spec.rb +88 -0
- data/spec/models/fee_object_item_spec.rb +66 -0
- data/spec/models/fee_object_spec.rb +206 -0
- data/spec/models/fee_spec.rb +34 -0
- data/spec/models/fee_update_input_fee_spec.rb +38 -0
- data/spec/models/fee_update_input_spec.rb +34 -0
- data/spec/models/fees_paginated_spec.rb +40 -0
- data/spec/models/fees_spec.rb +34 -0
- data/spec/models/find_all_webhook_endpoints200_response_spec.rb +40 -0
- data/spec/models/get_customer_portal_url200_response_customer_spec.rb +34 -0
- data/spec/models/get_customer_portal_url200_response_spec.rb +34 -0
- data/spec/models/group_object_spec.rb +46 -0
- data/spec/models/group_properties_object_spec.rb +40 -0
- data/spec/models/group_properties_object_values_spec.rb +100 -0
- data/spec/models/groups_paginated_spec.rb +40 -0
- data/spec/models/invoice_applied_tax_object_spec.rb +94 -0
- data/spec/models/invoice_metadata_object_spec.rb +52 -0
- data/spec/models/invoice_object_customer_spec.rb +184 -0
- data/spec/models/invoice_object_extended_spec.rb +196 -0
- data/spec/models/invoice_object_spec.rb +178 -0
- data/spec/models/invoice_one_off_create_input_invoice_fees_inner_spec.rb +58 -0
- data/spec/models/invoice_one_off_create_input_invoice_spec.rb +46 -0
- data/spec/models/invoice_one_off_create_input_spec.rb +34 -0
- data/spec/models/invoice_spec.rb +34 -0
- data/spec/models/invoice_update_input_invoice_metadata_inner_spec.rb +46 -0
- data/spec/models/invoice_update_input_invoice_spec.rb +44 -0
- data/spec/models/invoice_update_input_spec.rb +34 -0
- data/spec/models/invoices_paginated_spec.rb +40 -0
- data/spec/models/organization_billing_configuration_spec.rb +46 -0
- data/spec/models/organization_object_spec.rb +142 -0
- data/spec/models/organization_spec.rb +34 -0
- data/spec/models/organization_update_input_organization_spec.rb +122 -0
- data/spec/models/organization_update_input_spec.rb +34 -0
- data/spec/models/pagination_meta_spec.rb +58 -0
- data/spec/models/plan_create_input_plan_charges_inner_group_properties_inner_spec.rb +40 -0
- data/spec/models/plan_create_input_plan_charges_inner_spec.rb +86 -0
- data/spec/models/plan_create_input_plan_spec.rb +98 -0
- data/spec/models/plan_create_input_spec.rb +34 -0
- data/spec/models/plan_object_spec.rb +122 -0
- data/spec/models/plan_spec.rb +34 -0
- data/spec/models/plan_update_input_plan_charges_inner_spec.rb +92 -0
- data/spec/models/plan_update_input_plan_spec.rb +98 -0
- data/spec/models/plan_update_input_spec.rb +34 -0
- data/spec/models/plans_paginated_spec.rb +40 -0
- data/spec/models/subscription_create_input_spec.rb +34 -0
- data/spec/models/subscription_create_input_subscription_spec.rb +68 -0
- data/spec/models/subscription_object_spec.rb +132 -0
- data/spec/models/subscription_spec.rb +34 -0
- data/spec/models/subscription_update_input_spec.rb +34 -0
- data/spec/models/subscription_update_input_subscription_spec.rb +40 -0
- data/spec/models/subscriptions_paginated_spec.rb +40 -0
- data/spec/models/tax_base_input_spec.rb +58 -0
- data/spec/models/tax_create_input_spec.rb +34 -0
- data/spec/models/tax_create_input_tax_spec.rb +66 -0
- data/spec/models/tax_object_spec.rb +94 -0
- data/spec/models/tax_spec.rb +34 -0
- data/spec/models/tax_update_input_spec.rb +34 -0
- data/spec/models/taxes_paginated_spec.rb +40 -0
- data/spec/models/timezone_spec.rb +28 -0
- data/spec/models/wallet_create_input_spec.rb +34 -0
- data/spec/models/wallet_create_input_wallet_spec.rb +80 -0
- data/spec/models/wallet_object_spec.rb +140 -0
- data/spec/models/wallet_spec.rb +34 -0
- data/spec/models/wallet_transaction_create_input_spec.rb +34 -0
- data/spec/models/wallet_transaction_create_input_wallet_transaction_spec.rb +46 -0
- data/spec/models/wallet_transaction_object_spec.rb +95 -0
- data/spec/models/wallet_transactions_paginated_spec.rb +40 -0
- data/spec/models/wallet_transactions_spec.rb +34 -0
- data/spec/models/wallet_update_input_spec.rb +34 -0
- data/spec/models/wallet_update_input_wallet_spec.rb +40 -0
- data/spec/models/wallets_paginated_spec.rb +40 -0
- data/spec/spec_helper.rb +111 -0
- metadata +818 -0
@@ -0,0 +1,238 @@
|
|
1
|
+
=begin
|
2
|
+
#Lago API documentation
|
3
|
+
|
4
|
+
#Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 0.46.0-beta
|
7
|
+
Contact: tech@getlago.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 7.0.1-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module LagoAPI
|
17
|
+
class PlanCreateInputPlanChargesInnerGroupPropertiesInner
|
18
|
+
# Unique identifier of a billable metric group, created by Lago.
|
19
|
+
attr_accessor :group_id
|
20
|
+
|
21
|
+
attr_accessor :values
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'group_id' => :'group_id',
|
27
|
+
:'values' => :'values'
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
# Returns all the JSON keys this model knows about
|
32
|
+
def self.acceptable_attributes
|
33
|
+
attribute_map.values
|
34
|
+
end
|
35
|
+
|
36
|
+
# Attribute type mapping.
|
37
|
+
def self.openapi_types
|
38
|
+
{
|
39
|
+
:'group_id' => :'String',
|
40
|
+
:'values' => :'GroupPropertiesObjectValues'
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
# List of attributes with nullable: true
|
45
|
+
def self.openapi_nullable
|
46
|
+
Set.new([
|
47
|
+
])
|
48
|
+
end
|
49
|
+
|
50
|
+
# Initializes the object
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
52
|
+
def initialize(attributes = {})
|
53
|
+
if (!attributes.is_a?(Hash))
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `LagoAPI::PlanCreateInputPlanChargesInnerGroupPropertiesInner` initialize method"
|
55
|
+
end
|
56
|
+
|
57
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
58
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
59
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
60
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `LagoAPI::PlanCreateInputPlanChargesInnerGroupPropertiesInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
61
|
+
end
|
62
|
+
h[k.to_sym] = v
|
63
|
+
}
|
64
|
+
|
65
|
+
if attributes.key?(:'group_id')
|
66
|
+
self.group_id = attributes[:'group_id']
|
67
|
+
else
|
68
|
+
self.group_id = nil
|
69
|
+
end
|
70
|
+
|
71
|
+
if attributes.key?(:'values')
|
72
|
+
self.values = attributes[:'values']
|
73
|
+
else
|
74
|
+
self.values = nil
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
79
|
+
# @return Array for valid properties with the reasons
|
80
|
+
def list_invalid_properties
|
81
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
82
|
+
invalid_properties = Array.new
|
83
|
+
if @group_id.nil?
|
84
|
+
invalid_properties.push('invalid value for "group_id", group_id cannot be nil.')
|
85
|
+
end
|
86
|
+
|
87
|
+
if @values.nil?
|
88
|
+
invalid_properties.push('invalid value for "values", values cannot be nil.')
|
89
|
+
end
|
90
|
+
|
91
|
+
invalid_properties
|
92
|
+
end
|
93
|
+
|
94
|
+
# Check to see if the all the properties in the model are valid
|
95
|
+
# @return true if the model is valid
|
96
|
+
def valid?
|
97
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
98
|
+
return false if @group_id.nil?
|
99
|
+
return false if @values.nil?
|
100
|
+
true
|
101
|
+
end
|
102
|
+
|
103
|
+
# Checks equality by comparing each attribute.
|
104
|
+
# @param [Object] Object to be compared
|
105
|
+
def ==(o)
|
106
|
+
return true if self.equal?(o)
|
107
|
+
self.class == o.class &&
|
108
|
+
group_id == o.group_id &&
|
109
|
+
values == o.values
|
110
|
+
end
|
111
|
+
|
112
|
+
# @see the `==` method
|
113
|
+
# @param [Object] Object to be compared
|
114
|
+
def eql?(o)
|
115
|
+
self == o
|
116
|
+
end
|
117
|
+
|
118
|
+
# Calculates hash code according to all attributes.
|
119
|
+
# @return [Integer] Hash code
|
120
|
+
def hash
|
121
|
+
[group_id, values].hash
|
122
|
+
end
|
123
|
+
|
124
|
+
# Builds the object from hash
|
125
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
126
|
+
# @return [Object] Returns the model itself
|
127
|
+
def self.build_from_hash(attributes)
|
128
|
+
return nil unless attributes.is_a?(Hash)
|
129
|
+
attributes = attributes.transform_keys(&:to_sym)
|
130
|
+
transformed_hash = {}
|
131
|
+
openapi_types.each_pair do |key, type|
|
132
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
133
|
+
transformed_hash["#{key}"] = nil
|
134
|
+
elsif type =~ /\AArray<(.*)>/i
|
135
|
+
# check to ensure the input is an array given that the attribute
|
136
|
+
# is documented as an array but the input is not
|
137
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
138
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
139
|
+
end
|
140
|
+
elsif !attributes[attribute_map[key]].nil?
|
141
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
142
|
+
end
|
143
|
+
end
|
144
|
+
new(transformed_hash)
|
145
|
+
end
|
146
|
+
|
147
|
+
# Deserializes the data based on type
|
148
|
+
# @param string type Data type
|
149
|
+
# @param string value Value to be deserialized
|
150
|
+
# @return [Object] Deserialized data
|
151
|
+
def self._deserialize(type, value)
|
152
|
+
case type.to_sym
|
153
|
+
when :Time
|
154
|
+
Time.parse(value)
|
155
|
+
when :Date
|
156
|
+
Date.parse(value)
|
157
|
+
when :String
|
158
|
+
value.to_s
|
159
|
+
when :Integer
|
160
|
+
value.to_i
|
161
|
+
when :Float
|
162
|
+
value.to_f
|
163
|
+
when :Boolean
|
164
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
165
|
+
true
|
166
|
+
else
|
167
|
+
false
|
168
|
+
end
|
169
|
+
when :Object
|
170
|
+
# generic object (usually a Hash), return directly
|
171
|
+
value
|
172
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
173
|
+
inner_type = Regexp.last_match[:inner_type]
|
174
|
+
value.map { |v| _deserialize(inner_type, v) }
|
175
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
176
|
+
k_type = Regexp.last_match[:k_type]
|
177
|
+
v_type = Regexp.last_match[:v_type]
|
178
|
+
{}.tap do |hash|
|
179
|
+
value.each do |k, v|
|
180
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
181
|
+
end
|
182
|
+
end
|
183
|
+
else # model
|
184
|
+
# models (e.g. Pet) or oneOf
|
185
|
+
klass = LagoAPI.const_get(type)
|
186
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
# Returns the string representation of the object
|
191
|
+
# @return [String] String presentation of the object
|
192
|
+
def to_s
|
193
|
+
to_hash.to_s
|
194
|
+
end
|
195
|
+
|
196
|
+
# to_body is an alias to to_hash (backward compatibility)
|
197
|
+
# @return [Hash] Returns the object in the form of hash
|
198
|
+
def to_body
|
199
|
+
to_hash
|
200
|
+
end
|
201
|
+
|
202
|
+
# Returns the object in the form of hash
|
203
|
+
# @return [Hash] Returns the object in the form of hash
|
204
|
+
def to_hash
|
205
|
+
hash = {}
|
206
|
+
self.class.attribute_map.each_pair do |attr, param|
|
207
|
+
value = self.send(attr)
|
208
|
+
if value.nil?
|
209
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
210
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
211
|
+
end
|
212
|
+
|
213
|
+
hash[param] = _to_hash(value)
|
214
|
+
end
|
215
|
+
hash
|
216
|
+
end
|
217
|
+
|
218
|
+
# Outputs non-array value in the form of hash
|
219
|
+
# For object, use to_hash. Otherwise, just return the value
|
220
|
+
# @param [Object] value Any valid value
|
221
|
+
# @return [Hash] Returns the value in the form of hash
|
222
|
+
def _to_hash(value)
|
223
|
+
if value.is_a?(Array)
|
224
|
+
value.compact.map { |v| _to_hash(v) }
|
225
|
+
elsif value.is_a?(Hash)
|
226
|
+
{}.tap do |hash|
|
227
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
228
|
+
end
|
229
|
+
elsif value.respond_to? :to_hash
|
230
|
+
value.to_hash
|
231
|
+
else
|
232
|
+
value
|
233
|
+
end
|
234
|
+
end
|
235
|
+
|
236
|
+
end
|
237
|
+
|
238
|
+
end
|
@@ -0,0 +1,456 @@
|
|
1
|
+
=begin
|
2
|
+
#Lago API documentation
|
3
|
+
|
4
|
+
#Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 0.46.0-beta
|
7
|
+
Contact: tech@getlago.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 7.0.1-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module LagoAPI
|
17
|
+
class PlanObject
|
18
|
+
# Unique identifier of the plan created by Lago.
|
19
|
+
attr_accessor :lago_id
|
20
|
+
|
21
|
+
# The name of the plan.
|
22
|
+
attr_accessor :name
|
23
|
+
|
24
|
+
# The date and time when the plan was created. It is expressed in UTC format according to the ISO 8601 datetime standard. This field provides the timestamp for the exact moment when the plan was initially created.
|
25
|
+
attr_accessor :created_at
|
26
|
+
|
27
|
+
# The code of the plan. It serves as a unique identifier associated with a particular plan. The code is typically used for internal or system-level identification purposes, like assigning a subscription, for instance.
|
28
|
+
attr_accessor :code
|
29
|
+
|
30
|
+
# The interval used for recurring billing. It represents the frequency at which subscription billing occurs. The interval can be one of the following values: `yearly`, `quarterly`, `monthly` or `weekly`.
|
31
|
+
attr_accessor :interval
|
32
|
+
|
33
|
+
# The description on the plan.
|
34
|
+
attr_accessor :description
|
35
|
+
|
36
|
+
# The base cost of the plan, excluding any applicable taxes, that is billed on a recurring basis. This value is defined at 0 if your plan is a pay-as-you-go plan.
|
37
|
+
attr_accessor :amount_cents
|
38
|
+
|
39
|
+
attr_accessor :amount_currency
|
40
|
+
|
41
|
+
# The duration in days during which the base cost of the plan is offered for free.
|
42
|
+
attr_accessor :trial_period
|
43
|
+
|
44
|
+
# This field determines the billing timing for the plan. When set to `true`, the base cost of the plan is due at the beginning of each billing period. Conversely, when set to `false`, the base cost of the plan is due at the end of each billing period.
|
45
|
+
attr_accessor :pay_in_advance
|
46
|
+
|
47
|
+
# This field, when set to `true`, enables to invoice usage-based charges on monthly basis, even if the cadence of the plan is yearly. This allows customers to pay charges overage on a monthly basis. This can be set to true only if the plan’s interval is `yearly`.
|
48
|
+
attr_accessor :bill_charges_monthly
|
49
|
+
|
50
|
+
# The count of active subscriptions that are currently associated with the plan. This field provides valuable information regarding the impact of deleting the plan. By checking the value of this field, you can determine the number of subscriptions that will be affected if the plan is deleted.
|
51
|
+
attr_accessor :active_subscriptions_count
|
52
|
+
|
53
|
+
# The number of draft invoices that include a subscription attached to the plan. This field provides valuable information about the impact of deleting the plan. By checking the value of this field, you can determine the number of draft invoices that will be affected if the plan is deleted.
|
54
|
+
attr_accessor :draft_invoices_count
|
55
|
+
|
56
|
+
# Additional usage-based charges for this plan.
|
57
|
+
attr_accessor :charges
|
58
|
+
|
59
|
+
# All taxes applied to the plan.
|
60
|
+
attr_accessor :taxes
|
61
|
+
|
62
|
+
class EnumAttributeValidator
|
63
|
+
attr_reader :datatype
|
64
|
+
attr_reader :allowable_values
|
65
|
+
|
66
|
+
def initialize(datatype, allowable_values)
|
67
|
+
@allowable_values = allowable_values.map do |value|
|
68
|
+
case datatype.to_s
|
69
|
+
when /Integer/i
|
70
|
+
value.to_i
|
71
|
+
when /Float/i
|
72
|
+
value.to_f
|
73
|
+
else
|
74
|
+
value
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
def valid?(value)
|
80
|
+
!value || allowable_values.include?(value)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
85
|
+
def self.attribute_map
|
86
|
+
{
|
87
|
+
:'lago_id' => :'lago_id',
|
88
|
+
:'name' => :'name',
|
89
|
+
:'created_at' => :'created_at',
|
90
|
+
:'code' => :'code',
|
91
|
+
:'interval' => :'interval',
|
92
|
+
:'description' => :'description',
|
93
|
+
:'amount_cents' => :'amount_cents',
|
94
|
+
:'amount_currency' => :'amount_currency',
|
95
|
+
:'trial_period' => :'trial_period',
|
96
|
+
:'pay_in_advance' => :'pay_in_advance',
|
97
|
+
:'bill_charges_monthly' => :'bill_charges_monthly',
|
98
|
+
:'active_subscriptions_count' => :'active_subscriptions_count',
|
99
|
+
:'draft_invoices_count' => :'draft_invoices_count',
|
100
|
+
:'charges' => :'charges',
|
101
|
+
:'taxes' => :'taxes'
|
102
|
+
}
|
103
|
+
end
|
104
|
+
|
105
|
+
# Returns all the JSON keys this model knows about
|
106
|
+
def self.acceptable_attributes
|
107
|
+
attribute_map.values
|
108
|
+
end
|
109
|
+
|
110
|
+
# Attribute type mapping.
|
111
|
+
def self.openapi_types
|
112
|
+
{
|
113
|
+
:'lago_id' => :'String',
|
114
|
+
:'name' => :'String',
|
115
|
+
:'created_at' => :'Time',
|
116
|
+
:'code' => :'String',
|
117
|
+
:'interval' => :'String',
|
118
|
+
:'description' => :'String',
|
119
|
+
:'amount_cents' => :'Integer',
|
120
|
+
:'amount_currency' => :'Currency',
|
121
|
+
:'trial_period' => :'Float',
|
122
|
+
:'pay_in_advance' => :'Boolean',
|
123
|
+
:'bill_charges_monthly' => :'Boolean',
|
124
|
+
:'active_subscriptions_count' => :'Integer',
|
125
|
+
:'draft_invoices_count' => :'Integer',
|
126
|
+
:'charges' => :'Array<ChargeObject>',
|
127
|
+
:'taxes' => :'Array<TaxObject>'
|
128
|
+
}
|
129
|
+
end
|
130
|
+
|
131
|
+
# List of attributes with nullable: true
|
132
|
+
def self.openapi_nullable
|
133
|
+
Set.new([
|
134
|
+
:'bill_charges_monthly',
|
135
|
+
])
|
136
|
+
end
|
137
|
+
|
138
|
+
# Initializes the object
|
139
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
140
|
+
def initialize(attributes = {})
|
141
|
+
if (!attributes.is_a?(Hash))
|
142
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `LagoAPI::PlanObject` initialize method"
|
143
|
+
end
|
144
|
+
|
145
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
146
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
147
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
148
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `LagoAPI::PlanObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
149
|
+
end
|
150
|
+
h[k.to_sym] = v
|
151
|
+
}
|
152
|
+
|
153
|
+
if attributes.key?(:'lago_id')
|
154
|
+
self.lago_id = attributes[:'lago_id']
|
155
|
+
else
|
156
|
+
self.lago_id = nil
|
157
|
+
end
|
158
|
+
|
159
|
+
if attributes.key?(:'name')
|
160
|
+
self.name = attributes[:'name']
|
161
|
+
else
|
162
|
+
self.name = nil
|
163
|
+
end
|
164
|
+
|
165
|
+
if attributes.key?(:'created_at')
|
166
|
+
self.created_at = attributes[:'created_at']
|
167
|
+
else
|
168
|
+
self.created_at = nil
|
169
|
+
end
|
170
|
+
|
171
|
+
if attributes.key?(:'code')
|
172
|
+
self.code = attributes[:'code']
|
173
|
+
else
|
174
|
+
self.code = nil
|
175
|
+
end
|
176
|
+
|
177
|
+
if attributes.key?(:'interval')
|
178
|
+
self.interval = attributes[:'interval']
|
179
|
+
else
|
180
|
+
self.interval = nil
|
181
|
+
end
|
182
|
+
|
183
|
+
if attributes.key?(:'description')
|
184
|
+
self.description = attributes[:'description']
|
185
|
+
end
|
186
|
+
|
187
|
+
if attributes.key?(:'amount_cents')
|
188
|
+
self.amount_cents = attributes[:'amount_cents']
|
189
|
+
else
|
190
|
+
self.amount_cents = nil
|
191
|
+
end
|
192
|
+
|
193
|
+
if attributes.key?(:'amount_currency')
|
194
|
+
self.amount_currency = attributes[:'amount_currency']
|
195
|
+
else
|
196
|
+
self.amount_currency = nil
|
197
|
+
end
|
198
|
+
|
199
|
+
if attributes.key?(:'trial_period')
|
200
|
+
self.trial_period = attributes[:'trial_period']
|
201
|
+
end
|
202
|
+
|
203
|
+
if attributes.key?(:'pay_in_advance')
|
204
|
+
self.pay_in_advance = attributes[:'pay_in_advance']
|
205
|
+
end
|
206
|
+
|
207
|
+
if attributes.key?(:'bill_charges_monthly')
|
208
|
+
self.bill_charges_monthly = attributes[:'bill_charges_monthly']
|
209
|
+
end
|
210
|
+
|
211
|
+
if attributes.key?(:'active_subscriptions_count')
|
212
|
+
self.active_subscriptions_count = attributes[:'active_subscriptions_count']
|
213
|
+
else
|
214
|
+
self.active_subscriptions_count = nil
|
215
|
+
end
|
216
|
+
|
217
|
+
if attributes.key?(:'draft_invoices_count')
|
218
|
+
self.draft_invoices_count = attributes[:'draft_invoices_count']
|
219
|
+
else
|
220
|
+
self.draft_invoices_count = nil
|
221
|
+
end
|
222
|
+
|
223
|
+
if attributes.key?(:'charges')
|
224
|
+
if (value = attributes[:'charges']).is_a?(Array)
|
225
|
+
self.charges = value
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
229
|
+
if attributes.key?(:'taxes')
|
230
|
+
if (value = attributes[:'taxes']).is_a?(Array)
|
231
|
+
self.taxes = value
|
232
|
+
end
|
233
|
+
end
|
234
|
+
end
|
235
|
+
|
236
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
237
|
+
# @return Array for valid properties with the reasons
|
238
|
+
def list_invalid_properties
|
239
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
240
|
+
invalid_properties = Array.new
|
241
|
+
if @lago_id.nil?
|
242
|
+
invalid_properties.push('invalid value for "lago_id", lago_id cannot be nil.')
|
243
|
+
end
|
244
|
+
|
245
|
+
if @name.nil?
|
246
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
247
|
+
end
|
248
|
+
|
249
|
+
if @created_at.nil?
|
250
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
251
|
+
end
|
252
|
+
|
253
|
+
if @code.nil?
|
254
|
+
invalid_properties.push('invalid value for "code", code cannot be nil.')
|
255
|
+
end
|
256
|
+
|
257
|
+
if @interval.nil?
|
258
|
+
invalid_properties.push('invalid value for "interval", interval cannot be nil.')
|
259
|
+
end
|
260
|
+
|
261
|
+
if @amount_cents.nil?
|
262
|
+
invalid_properties.push('invalid value for "amount_cents", amount_cents cannot be nil.')
|
263
|
+
end
|
264
|
+
|
265
|
+
if @amount_currency.nil?
|
266
|
+
invalid_properties.push('invalid value for "amount_currency", amount_currency cannot be nil.')
|
267
|
+
end
|
268
|
+
|
269
|
+
if @active_subscriptions_count.nil?
|
270
|
+
invalid_properties.push('invalid value for "active_subscriptions_count", active_subscriptions_count cannot be nil.')
|
271
|
+
end
|
272
|
+
|
273
|
+
if @draft_invoices_count.nil?
|
274
|
+
invalid_properties.push('invalid value for "draft_invoices_count", draft_invoices_count cannot be nil.')
|
275
|
+
end
|
276
|
+
|
277
|
+
invalid_properties
|
278
|
+
end
|
279
|
+
|
280
|
+
# Check to see if the all the properties in the model are valid
|
281
|
+
# @return true if the model is valid
|
282
|
+
def valid?
|
283
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
284
|
+
return false if @lago_id.nil?
|
285
|
+
return false if @name.nil?
|
286
|
+
return false if @created_at.nil?
|
287
|
+
return false if @code.nil?
|
288
|
+
return false if @interval.nil?
|
289
|
+
interval_validator = EnumAttributeValidator.new('String', ["weekly", "monthly", "quarterly", "yearly"])
|
290
|
+
return false unless interval_validator.valid?(@interval)
|
291
|
+
return false if @amount_cents.nil?
|
292
|
+
return false if @amount_currency.nil?
|
293
|
+
return false if @active_subscriptions_count.nil?
|
294
|
+
return false if @draft_invoices_count.nil?
|
295
|
+
true
|
296
|
+
end
|
297
|
+
|
298
|
+
# Custom attribute writer method checking allowed values (enum).
|
299
|
+
# @param [Object] interval Object to be assigned
|
300
|
+
def interval=(interval)
|
301
|
+
validator = EnumAttributeValidator.new('String', ["weekly", "monthly", "quarterly", "yearly"])
|
302
|
+
unless validator.valid?(interval)
|
303
|
+
fail ArgumentError, "invalid value for \"interval\", must be one of #{validator.allowable_values}."
|
304
|
+
end
|
305
|
+
@interval = interval
|
306
|
+
end
|
307
|
+
|
308
|
+
# Checks equality by comparing each attribute.
|
309
|
+
# @param [Object] Object to be compared
|
310
|
+
def ==(o)
|
311
|
+
return true if self.equal?(o)
|
312
|
+
self.class == o.class &&
|
313
|
+
lago_id == o.lago_id &&
|
314
|
+
name == o.name &&
|
315
|
+
created_at == o.created_at &&
|
316
|
+
code == o.code &&
|
317
|
+
interval == o.interval &&
|
318
|
+
description == o.description &&
|
319
|
+
amount_cents == o.amount_cents &&
|
320
|
+
amount_currency == o.amount_currency &&
|
321
|
+
trial_period == o.trial_period &&
|
322
|
+
pay_in_advance == o.pay_in_advance &&
|
323
|
+
bill_charges_monthly == o.bill_charges_monthly &&
|
324
|
+
active_subscriptions_count == o.active_subscriptions_count &&
|
325
|
+
draft_invoices_count == o.draft_invoices_count &&
|
326
|
+
charges == o.charges &&
|
327
|
+
taxes == o.taxes
|
328
|
+
end
|
329
|
+
|
330
|
+
# @see the `==` method
|
331
|
+
# @param [Object] Object to be compared
|
332
|
+
def eql?(o)
|
333
|
+
self == o
|
334
|
+
end
|
335
|
+
|
336
|
+
# Calculates hash code according to all attributes.
|
337
|
+
# @return [Integer] Hash code
|
338
|
+
def hash
|
339
|
+
[lago_id, name, created_at, code, interval, description, amount_cents, amount_currency, trial_period, pay_in_advance, bill_charges_monthly, active_subscriptions_count, draft_invoices_count, charges, taxes].hash
|
340
|
+
end
|
341
|
+
|
342
|
+
# Builds the object from hash
|
343
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
344
|
+
# @return [Object] Returns the model itself
|
345
|
+
def self.build_from_hash(attributes)
|
346
|
+
return nil unless attributes.is_a?(Hash)
|
347
|
+
attributes = attributes.transform_keys(&:to_sym)
|
348
|
+
transformed_hash = {}
|
349
|
+
openapi_types.each_pair do |key, type|
|
350
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
351
|
+
transformed_hash["#{key}"] = nil
|
352
|
+
elsif type =~ /\AArray<(.*)>/i
|
353
|
+
# check to ensure the input is an array given that the attribute
|
354
|
+
# is documented as an array but the input is not
|
355
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
356
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
357
|
+
end
|
358
|
+
elsif !attributes[attribute_map[key]].nil?
|
359
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
360
|
+
end
|
361
|
+
end
|
362
|
+
new(transformed_hash)
|
363
|
+
end
|
364
|
+
|
365
|
+
# Deserializes the data based on type
|
366
|
+
# @param string type Data type
|
367
|
+
# @param string value Value to be deserialized
|
368
|
+
# @return [Object] Deserialized data
|
369
|
+
def self._deserialize(type, value)
|
370
|
+
case type.to_sym
|
371
|
+
when :Time
|
372
|
+
Time.parse(value)
|
373
|
+
when :Date
|
374
|
+
Date.parse(value)
|
375
|
+
when :String
|
376
|
+
value.to_s
|
377
|
+
when :Integer
|
378
|
+
value.to_i
|
379
|
+
when :Float
|
380
|
+
value.to_f
|
381
|
+
when :Boolean
|
382
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
383
|
+
true
|
384
|
+
else
|
385
|
+
false
|
386
|
+
end
|
387
|
+
when :Object
|
388
|
+
# generic object (usually a Hash), return directly
|
389
|
+
value
|
390
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
391
|
+
inner_type = Regexp.last_match[:inner_type]
|
392
|
+
value.map { |v| _deserialize(inner_type, v) }
|
393
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
394
|
+
k_type = Regexp.last_match[:k_type]
|
395
|
+
v_type = Regexp.last_match[:v_type]
|
396
|
+
{}.tap do |hash|
|
397
|
+
value.each do |k, v|
|
398
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
399
|
+
end
|
400
|
+
end
|
401
|
+
else # model
|
402
|
+
# models (e.g. Pet) or oneOf
|
403
|
+
klass = LagoAPI.const_get(type)
|
404
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
405
|
+
end
|
406
|
+
end
|
407
|
+
|
408
|
+
# Returns the string representation of the object
|
409
|
+
# @return [String] String presentation of the object
|
410
|
+
def to_s
|
411
|
+
to_hash.to_s
|
412
|
+
end
|
413
|
+
|
414
|
+
# to_body is an alias to to_hash (backward compatibility)
|
415
|
+
# @return [Hash] Returns the object in the form of hash
|
416
|
+
def to_body
|
417
|
+
to_hash
|
418
|
+
end
|
419
|
+
|
420
|
+
# Returns the object in the form of hash
|
421
|
+
# @return [Hash] Returns the object in the form of hash
|
422
|
+
def to_hash
|
423
|
+
hash = {}
|
424
|
+
self.class.attribute_map.each_pair do |attr, param|
|
425
|
+
value = self.send(attr)
|
426
|
+
if value.nil?
|
427
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
428
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
429
|
+
end
|
430
|
+
|
431
|
+
hash[param] = _to_hash(value)
|
432
|
+
end
|
433
|
+
hash
|
434
|
+
end
|
435
|
+
|
436
|
+
# Outputs non-array value in the form of hash
|
437
|
+
# For object, use to_hash. Otherwise, just return the value
|
438
|
+
# @param [Object] value Any valid value
|
439
|
+
# @return [Hash] Returns the value in the form of hash
|
440
|
+
def _to_hash(value)
|
441
|
+
if value.is_a?(Array)
|
442
|
+
value.compact.map { |v| _to_hash(v) }
|
443
|
+
elsif value.is_a?(Hash)
|
444
|
+
{}.tap do |hash|
|
445
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
446
|
+
end
|
447
|
+
elsif value.respond_to? :to_hash
|
448
|
+
value.to_hash
|
449
|
+
else
|
450
|
+
value
|
451
|
+
end
|
452
|
+
end
|
453
|
+
|
454
|
+
end
|
455
|
+
|
456
|
+
end
|