maxio-advanced-billing-sdk 5.1.0 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +48 -50
- data/lib/advanced_billing/client.rb +3 -4
- data/lib/advanced_billing/configuration.rb +21 -24
- data/lib/advanced_billing/controllers/advance_invoice_controller.rb +3 -3
- data/lib/advanced_billing/controllers/api_exports_controller.rb +9 -9
- data/lib/advanced_billing/controllers/base_controller.rb +1 -1
- data/lib/advanced_billing/controllers/billing_portal_controller.rb +4 -4
- data/lib/advanced_billing/controllers/component_price_points_controller.rb +34 -20
- data/lib/advanced_billing/controllers/components_controller.rb +12 -12
- data/lib/advanced_billing/controllers/coupons_controller.rb +45 -27
- data/lib/advanced_billing/controllers/custom_fields_controller.rb +9 -9
- data/lib/advanced_billing/controllers/customers_controller.rb +7 -7
- data/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb +6 -6
- data/lib/advanced_billing/controllers/events_controller.rb +26 -9
- data/lib/advanced_billing/controllers/insights_controller.rb +4 -4
- data/lib/advanced_billing/controllers/invoices_controller.rb +17 -17
- data/lib/advanced_billing/controllers/offers_controller.rb +10 -6
- data/lib/advanced_billing/controllers/payment_profiles_controller.rb +12 -12
- data/lib/advanced_billing/controllers/product_families_controller.rb +22 -20
- data/lib/advanced_billing/controllers/product_price_points_controller.rb +14 -11
- data/lib/advanced_billing/controllers/products_controller.rb +6 -6
- data/lib/advanced_billing/controllers/proforma_invoices_controller.rb +9 -9
- data/lib/advanced_billing/controllers/reason_codes_controller.rb +17 -9
- data/lib/advanced_billing/controllers/referral_codes_controller.rb +1 -1
- data/lib/advanced_billing/controllers/sales_commissions_controller.rb +3 -3
- data/lib/advanced_billing/controllers/sites_controller.rb +3 -3
- data/lib/advanced_billing/controllers/subscription_components_controller.rb +21 -31
- data/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb +4 -4
- data/lib/advanced_billing/controllers/subscription_group_status_controller.rb +4 -4
- data/lib/advanced_billing/controllers/subscription_groups_controller.rb +9 -9
- data/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb +6 -6
- data/lib/advanced_billing/controllers/subscription_notes_controller.rb +20 -8
- data/lib/advanced_billing/controllers/subscription_products_controller.rb +2 -2
- data/lib/advanced_billing/controllers/subscription_status_controller.rb +20 -12
- data/lib/advanced_billing/controllers/subscriptions_controller.rb +40 -17
- data/lib/advanced_billing/controllers/webhooks_controller.rb +6 -6
- data/lib/advanced_billing/exceptions/subscription_response_error_exception.rb +32 -0
- data/lib/advanced_billing/models/account_balance.rb +7 -7
- data/lib/advanced_billing/models/account_balances.rb +7 -7
- data/lib/advanced_billing/models/ach_agreement.rb +7 -7
- data/lib/advanced_billing/models/activate_event_based_component.rb +6 -6
- data/lib/advanced_billing/models/activate_subscription_request.rb +4 -4
- data/lib/advanced_billing/models/add_coupons_request.rb +4 -4
- data/lib/advanced_billing/models/add_subscription_to_a_group.rb +6 -18
- data/lib/advanced_billing/models/address_change.rb +5 -5
- data/lib/advanced_billing/models/agreement_acceptance.rb +7 -7
- data/lib/advanced_billing/models/allocate_components.rb +7 -7
- data/lib/advanced_billing/models/allocation.rb +7 -7
- data/lib/advanced_billing/models/allocation_expiration_date.rb +4 -4
- data/lib/advanced_billing/models/allocation_preview.rb +7 -7
- data/lib/advanced_billing/models/allocation_preview_item.rb +7 -7
- data/lib/advanced_billing/models/allocation_preview_line_item.rb +7 -7
- data/lib/advanced_billing/models/allocation_preview_response.rb +4 -4
- data/lib/advanced_billing/models/allocation_response.rb +4 -4
- data/lib/advanced_billing/models/allocation_settings.rb +6 -6
- data/lib/advanced_billing/models/apple_pay_payment_profile.rb +7 -7
- data/lib/advanced_billing/models/applied_credit_note_data.rb +5 -5
- data/lib/advanced_billing/models/apply_credit_note_event.rb +7 -7
- data/lib/advanced_billing/models/apply_credit_note_event_data.rb +7 -7
- data/lib/advanced_billing/models/apply_debit_note_event.rb +7 -7
- data/lib/advanced_billing/models/apply_debit_note_event_data.rb +7 -7
- data/lib/advanced_billing/models/apply_payment_event.rb +7 -7
- data/lib/advanced_billing/models/apply_payment_event_data.rb +7 -7
- data/lib/advanced_billing/models/attribute_error.rb +4 -4
- data/lib/advanced_billing/models/auto_resume.rb +4 -4
- data/lib/advanced_billing/models/backport_invoice_event.rb +7 -7
- data/lib/advanced_billing/models/bank_account_attributes.rb +7 -7
- data/lib/advanced_billing/models/bank_account_payment_profile.rb +7 -7
- data/lib/advanced_billing/models/bank_account_response.rb +4 -4
- data/lib/advanced_billing/models/bank_account_verification.rb +5 -5
- data/lib/advanced_billing/models/bank_account_verification_request.rb +4 -4
- data/lib/advanced_billing/models/base_model.rb +76 -28
- data/lib/advanced_billing/models/base_refund_error.rb +4 -4
- data/lib/advanced_billing/models/base_string_error.rb +4 -4
- data/lib/advanced_billing/models/batch_job.rb +7 -7
- data/lib/advanced_billing/models/batch_job_response.rb +4 -4
- data/lib/advanced_billing/models/billing_manifest.rb +7 -7
- data/lib/advanced_billing/models/billing_manifest_item.rb +7 -7
- data/lib/advanced_billing/models/billing_schedule.rb +4 -4
- data/lib/advanced_billing/models/breakouts.rb +7 -7
- data/lib/advanced_billing/models/bulk_components_price_point_assignment.rb +4 -4
- data/lib/advanced_billing/models/bulk_create_product_price_points_request.rb +4 -4
- data/lib/advanced_billing/models/bulk_create_product_price_points_response.rb +4 -4
- data/lib/advanced_billing/models/bulk_create_segments.rb +4 -4
- data/lib/advanced_billing/models/bulk_update_segments.rb +4 -4
- data/lib/advanced_billing/models/bulk_update_segments_item.rb +6 -6
- data/lib/advanced_billing/models/calendar_billing.rb +7 -7
- data/lib/advanced_billing/models/cancel_grouped_subscriptions_request.rb +4 -4
- data/lib/advanced_billing/models/cancellation_options.rb +5 -5
- data/lib/advanced_billing/models/cancellation_request.rb +4 -4
- data/lib/advanced_billing/models/change_chargeback_status_event.rb +7 -7
- data/lib/advanced_billing/models/change_chargeback_status_event_data.rb +4 -4
- data/lib/advanced_billing/models/change_invoice_collection_method_event.rb +7 -7
- data/lib/advanced_billing/models/change_invoice_collection_method_event_data.rb +5 -5
- data/lib/advanced_billing/models/change_invoice_status_event.rb +7 -7
- data/lib/advanced_billing/models/change_invoice_status_event_data.rb +7 -7
- data/lib/advanced_billing/models/chargify_ebb.rb +7 -7
- data/lib/advanced_billing/models/component.rb +9 -9
- data/lib/advanced_billing/models/component_allocation_change.rb +7 -7
- data/lib/advanced_billing/models/component_allocation_error_item.rb +7 -7
- data/lib/advanced_billing/models/component_cost_data.rb +7 -7
- data/lib/advanced_billing/models/component_cost_data_rate_tier.rb +7 -7
- data/lib/advanced_billing/models/component_currency_price.rb +7 -7
- data/lib/advanced_billing/models/component_currency_prices_response.rb +4 -4
- data/lib/advanced_billing/models/component_custom_price.rb +7 -7
- data/lib/advanced_billing/models/component_price.rb +7 -7
- data/lib/advanced_billing/models/component_price_point.rb +92 -7
- data/lib/advanced_billing/models/component_price_point_assignment.rb +5 -5
- data/lib/advanced_billing/models/component_price_point_error_item.rb +6 -6
- data/lib/advanced_billing/models/component_price_point_item.rb +7 -7
- data/lib/advanced_billing/models/component_price_point_response.rb +4 -4
- data/lib/advanced_billing/models/component_price_points_response.rb +5 -5
- data/lib/advanced_billing/models/component_response.rb +4 -4
- data/lib/advanced_billing/models/compounding_strategy.rb +5 -1
- data/lib/advanced_billing/models/consolidated_invoice.rb +4 -4
- data/lib/advanced_billing/models/count_response.rb +4 -4
- data/lib/advanced_billing/models/coupon.rb +104 -29
- data/lib/advanced_billing/models/coupon_currency.rb +12 -9
- data/lib/advanced_billing/models/coupon_currency_request.rb +4 -4
- data/lib/advanced_billing/models/coupon_currency_response.rb +4 -4
- data/lib/advanced_billing/models/coupon_payload.rb +244 -0
- data/lib/advanced_billing/models/{create_or_update_coupon.rb → coupon_request.rb} +13 -25
- data/lib/advanced_billing/models/coupon_response.rb +4 -4
- data/lib/advanced_billing/models/coupon_restriction.rb +7 -7
- data/lib/advanced_billing/models/coupon_subcodes.rb +4 -4
- data/lib/advanced_billing/models/coupon_subcodes_response.rb +6 -6
- data/lib/advanced_billing/models/coupon_usage.rb +7 -7
- data/lib/advanced_billing/models/create_allocation.rb +7 -7
- data/lib/advanced_billing/models/create_allocation_request.rb +4 -4
- data/lib/advanced_billing/models/create_component_price_point.rb +11 -9
- data/lib/advanced_billing/models/create_component_price_point_request.rb +4 -4
- data/lib/advanced_billing/models/create_component_price_points_request.rb +4 -4
- data/lib/advanced_billing/models/create_credit_note_event.rb +7 -7
- data/lib/advanced_billing/models/create_currency_price.rb +6 -6
- data/lib/advanced_billing/models/create_currency_prices_request.rb +4 -4
- data/lib/advanced_billing/models/create_customer.rb +7 -7
- data/lib/advanced_billing/models/create_customer_request.rb +4 -4
- data/lib/advanced_billing/models/create_debit_note_event.rb +7 -7
- data/lib/advanced_billing/models/create_ebb_component.rb +4 -4
- data/lib/advanced_billing/models/create_invoice.rb +7 -7
- data/lib/advanced_billing/models/create_invoice_address.rb +7 -7
- data/lib/advanced_billing/models/create_invoice_coupon.rb +12 -8
- data/lib/advanced_billing/models/create_invoice_item.rb +7 -7
- data/lib/advanced_billing/models/create_invoice_payment.rb +24 -10
- data/lib/advanced_billing/models/create_invoice_payment_application.rb +5 -5
- data/lib/advanced_billing/models/create_invoice_payment_request.rb +5 -5
- data/lib/advanced_billing/models/create_invoice_request.rb +4 -4
- data/lib/advanced_billing/models/create_metadata.rb +5 -5
- data/lib/advanced_billing/models/create_metadata_request.rb +4 -4
- data/lib/advanced_billing/models/create_metafield.rb +7 -7
- data/lib/advanced_billing/models/create_metafields_request.rb +4 -4
- data/lib/advanced_billing/models/create_metered_component.rb +4 -4
- data/lib/advanced_billing/models/create_multi_invoice_payment.rb +7 -7
- data/lib/advanced_billing/models/create_multi_invoice_payment_request.rb +4 -4
- data/lib/advanced_billing/models/create_offer.rb +7 -7
- data/lib/advanced_billing/models/create_offer_component.rb +6 -6
- data/lib/advanced_billing/models/create_offer_request.rb +4 -4
- data/lib/advanced_billing/models/create_on_off_component.rb +4 -4
- data/lib/advanced_billing/models/create_or_update_endpoint.rb +5 -5
- data/lib/advanced_billing/models/create_or_update_endpoint_request.rb +4 -4
- data/lib/advanced_billing/models/create_or_update_product.rb +7 -7
- data/lib/advanced_billing/models/create_or_update_product_request.rb +4 -4
- data/lib/advanced_billing/models/create_or_update_segment_price.rb +6 -6
- data/lib/advanced_billing/models/create_payment.rb +7 -7
- data/lib/advanced_billing/models/create_payment_profile.rb +7 -7
- data/lib/advanced_billing/models/create_payment_profile_request.rb +4 -4
- data/lib/advanced_billing/models/create_prepaid_component.rb +4 -4
- data/lib/advanced_billing/models/create_prepaid_usage_component_price_point.rb +14 -13
- data/lib/advanced_billing/models/create_prepayment.rb +7 -7
- data/lib/advanced_billing/models/create_prepayment_request.rb +4 -4
- data/lib/advanced_billing/models/create_prepayment_response.rb +4 -4
- data/lib/advanced_billing/models/create_product_currency_price.rb +6 -6
- data/lib/advanced_billing/models/create_product_currency_prices_request.rb +4 -4
- data/lib/advanced_billing/models/create_product_family.rb +6 -6
- data/lib/advanced_billing/models/create_product_family_request.rb +4 -4
- data/lib/advanced_billing/models/create_product_price_point.rb +7 -7
- data/lib/advanced_billing/models/create_product_price_point_request.rb +4 -4
- data/lib/advanced_billing/models/create_quantity_based_component.rb +4 -4
- data/lib/advanced_billing/models/create_reason_code.rb +6 -6
- data/lib/advanced_billing/models/create_reason_code_request.rb +4 -4
- data/lib/advanced_billing/models/create_segment.rb +7 -7
- data/lib/advanced_billing/models/create_segment_request.rb +4 -4
- data/lib/advanced_billing/models/create_subscription.rb +7 -8
- data/lib/advanced_billing/models/create_subscription_component.rb +7 -7
- data/lib/advanced_billing/models/create_subscription_group.rb +5 -5
- data/lib/advanced_billing/models/create_subscription_group_request.rb +4 -4
- data/lib/advanced_billing/models/create_subscription_request.rb +4 -4
- data/lib/advanced_billing/models/create_usage.rb +7 -7
- data/lib/advanced_billing/models/create_usage_request.rb +4 -4
- data/lib/advanced_billing/models/created_prepayment.rb +7 -7
- data/lib/advanced_billing/models/credit_account_balance_changed.rb +7 -7
- data/lib/advanced_billing/models/credit_card_attributes.rb +6 -6
- data/lib/advanced_billing/models/credit_card_payment_profile.rb +7 -7
- data/lib/advanced_billing/models/credit_note.rb +7 -7
- data/lib/advanced_billing/models/credit_note_application.rb +7 -7
- data/lib/advanced_billing/models/credit_note_line_item.rb +7 -7
- data/lib/advanced_billing/models/credit_scheme_request.rb +4 -4
- data/lib/advanced_billing/models/currency_price.rb +27 -7
- data/lib/advanced_billing/models/currency_prices_response.rb +4 -4
- data/lib/advanced_billing/models/custom_field_value_change.rb +7 -7
- data/lib/advanced_billing/models/customer.rb +35 -8
- data/lib/advanced_billing/models/customer_attributes.rb +22 -6
- data/lib/advanced_billing/models/customer_change.rb +7 -7
- data/lib/advanced_billing/models/customer_changes_preview_response.rb +4 -4
- data/lib/advanced_billing/models/customer_custom_fields_change.rb +5 -5
- data/lib/advanced_billing/models/customer_error.rb +4 -4
- data/lib/advanced_billing/models/customer_payer_change.rb +5 -5
- data/lib/advanced_billing/models/customer_response.rb +4 -4
- data/lib/advanced_billing/models/debit_note.rb +7 -7
- data/lib/advanced_billing/models/deduct_service_credit.rb +5 -5
- data/lib/advanced_billing/models/deduct_service_credit_request.rb +4 -4
- data/lib/advanced_billing/models/delayed_cancellation_response.rb +4 -4
- data/lib/advanced_billing/models/delete_subscription_group_response.rb +5 -5
- data/lib/advanced_billing/models/dunner_data.rb +7 -7
- data/lib/advanced_billing/models/dunning_step_data.rb +7 -7
- data/lib/advanced_billing/models/dunning_step_reached.rb +6 -6
- data/lib/advanced_billing/models/ebb_component.rb +17 -53
- data/lib/advanced_billing/models/ebb_event.rb +4 -4
- data/lib/advanced_billing/models/enable_webhooks_request.rb +4 -4
- data/lib/advanced_billing/models/enable_webhooks_response.rb +4 -4
- data/lib/advanced_billing/models/endpoint.rb +7 -7
- data/lib/advanced_billing/models/endpoint_response.rb +4 -4
- data/lib/advanced_billing/models/errors.rb +5 -5
- data/lib/advanced_billing/models/event.rb +71 -11
- data/lib/advanced_billing/models/event_based_billing_segment_error.rb +4 -4
- data/lib/advanced_billing/models/event_key.rb +264 -0
- data/lib/advanced_billing/models/event_response.rb +4 -4
- data/lib/advanced_billing/models/failed_payment_event.rb +7 -7
- data/lib/advanced_billing/models/failed_payment_event_data.rb +7 -7
- data/lib/advanced_billing/models/full_subscription_group_response.rb +7 -7
- data/lib/advanced_billing/models/get_one_time_token_payment_profile.rb +7 -7
- data/lib/advanced_billing/models/get_one_time_token_request.rb +4 -4
- data/lib/advanced_billing/models/group_billing.rb +6 -6
- data/lib/advanced_billing/models/group_settings.rb +5 -5
- data/lib/advanced_billing/models/group_target.rb +5 -5
- data/lib/advanced_billing/models/historic_usage.rb +6 -6
- data/lib/advanced_billing/models/invoice.rb +52 -13
- data/lib/advanced_billing/models/invoice_address.rb +7 -7
- data/lib/advanced_billing/models/invoice_avatax_details.rb +130 -0
- data/lib/advanced_billing/models/invoice_balance_item.rb +6 -6
- data/lib/advanced_billing/models/invoice_credit.rb +7 -7
- data/lib/advanced_billing/models/invoice_custom_field.rb +7 -7
- data/lib/advanced_billing/models/invoice_customer.rb +7 -7
- data/lib/advanced_billing/models/invoice_debit.rb +148 -0
- data/lib/advanced_billing/models/invoice_discount.rb +7 -7
- data/lib/advanced_billing/models/invoice_discount_breakout.rb +6 -6
- data/lib/advanced_billing/models/invoice_display_settings.rb +7 -7
- data/lib/advanced_billing/models/invoice_issued.rb +7 -7
- data/lib/advanced_billing/models/invoice_line_item.rb +21 -8
- data/lib/advanced_billing/models/invoice_line_item_component_cost_data.rb +4 -4
- data/lib/advanced_billing/models/invoice_line_item_event_data.rb +7 -7
- data/lib/advanced_billing/models/invoice_line_item_pricing_detail.rb +5 -5
- data/lib/advanced_billing/models/invoice_payer.rb +7 -7
- data/lib/advanced_billing/models/invoice_payer_change.rb +7 -7
- data/lib/advanced_billing/models/invoice_payment.rb +31 -8
- data/lib/advanced_billing/models/invoice_payment_application.rb +6 -6
- data/lib/advanced_billing/models/invoice_payment_method.rb +7 -7
- data/lib/advanced_billing/models/invoice_pre_payment.rb +6 -6
- data/lib/advanced_billing/models/invoice_previous_balance.rb +5 -5
- data/lib/advanced_billing/models/invoice_refund.rb +7 -7
- data/lib/advanced_billing/models/invoice_response.rb +4 -4
- data/lib/advanced_billing/models/invoice_seller.rb +7 -7
- data/lib/advanced_billing/models/invoice_status.rb +4 -1
- data/lib/advanced_billing/models/invoice_tax.rb +7 -7
- data/lib/advanced_billing/models/invoice_tax_breakout.rb +7 -7
- data/lib/advanced_billing/models/invoice_tax_component_breakout.rb +7 -7
- data/lib/advanced_billing/models/issue_advance_invoice_request.rb +4 -4
- data/lib/advanced_billing/models/issue_invoice_event.rb +7 -7
- data/lib/advanced_billing/models/issue_invoice_event_data.rb +7 -7
- data/lib/advanced_billing/models/issue_invoice_request.rb +4 -4
- data/lib/advanced_billing/models/issue_service_credit.rb +5 -5
- data/lib/advanced_billing/models/issue_service_credit_request.rb +4 -4
- data/lib/advanced_billing/models/item_price_point_changed.rb +7 -7
- data/lib/advanced_billing/models/item_price_point_data.rb +6 -6
- data/lib/advanced_billing/models/list_components_filter.rb +5 -5
- data/lib/advanced_billing/models/list_components_price_points_response.rb +4 -4
- data/lib/advanced_billing/models/list_coupons_filter.rb +7 -7
- data/lib/advanced_billing/models/list_credit_notes_response.rb +4 -4
- data/lib/advanced_billing/models/list_invoice_events_response.rb +7 -7
- data/lib/advanced_billing/models/list_invoices_response.rb +4 -4
- data/lib/advanced_billing/models/list_metafields_response.rb +7 -7
- data/lib/advanced_billing/models/list_mrr_filter.rb +4 -4
- data/lib/advanced_billing/models/list_mrr_response.rb +4 -4
- data/lib/advanced_billing/models/list_mrr_response_result.rb +7 -7
- data/lib/advanced_billing/models/list_offers_response.rb +4 -4
- data/lib/advanced_billing/models/list_prepayments_filter.rb +6 -6
- data/lib/advanced_billing/models/list_price_points_filter.rb +7 -7
- data/lib/advanced_billing/models/list_product_price_points_response.rb +4 -4
- data/lib/advanced_billing/models/list_products_filter.rb +7 -7
- data/lib/advanced_billing/models/list_proforma_invoices_meta.rb +7 -7
- data/lib/advanced_billing/models/list_proforma_invoices_response.rb +5 -5
- data/lib/advanced_billing/models/list_public_keys_meta.rb +7 -7
- data/lib/advanced_billing/models/list_public_keys_response.rb +5 -5
- data/lib/advanced_billing/models/list_sale_rep_item.rb +7 -7
- data/lib/advanced_billing/models/list_segments_filter.rb +7 -7
- data/lib/advanced_billing/models/list_segments_response.rb +4 -4
- data/lib/advanced_billing/models/list_subcription_group_prepayment_item.rb +7 -7
- data/lib/advanced_billing/models/list_subscription_components_filter.rb +5 -5
- data/lib/advanced_billing/models/list_subscription_components_for_site_filter.rb +6 -6
- data/lib/advanced_billing/models/list_subscription_components_response.rb +4 -4
- data/lib/advanced_billing/models/list_subscription_group_prepayment.rb +4 -4
- data/lib/advanced_billing/models/list_subscription_group_prepayment_response.rb +4 -4
- data/lib/advanced_billing/models/list_subscription_groups_item.rb +7 -7
- data/lib/advanced_billing/models/list_subscription_groups_meta.rb +5 -5
- data/lib/advanced_billing/models/list_subscription_groups_response.rb +5 -5
- data/lib/advanced_billing/models/metadata.rb +7 -7
- data/lib/advanced_billing/models/metafield.rb +7 -7
- data/lib/advanced_billing/models/metafield_scope.rb +7 -7
- data/lib/advanced_billing/models/metered_component.rb +22 -51
- data/lib/advanced_billing/models/metered_usage.rb +7 -7
- data/lib/advanced_billing/models/movement.rb +7 -7
- data/lib/advanced_billing/models/movement_line_item.rb +7 -7
- data/lib/advanced_billing/models/mrr.rb +7 -7
- data/lib/advanced_billing/models/mrr_movement.rb +7 -7
- data/lib/advanced_billing/models/mrr_response.rb +4 -4
- data/lib/advanced_billing/models/multi_invoice_payment.rb +7 -7
- data/lib/advanced_billing/models/multi_invoice_payment_response.rb +4 -4
- data/lib/advanced_billing/models/nested_subscription_group.rb +7 -7
- data/lib/advanced_billing/models/net_terms.rb +7 -7
- data/lib/advanced_billing/models/offer.rb +7 -7
- data/lib/advanced_billing/models/offer_discount.rb +6 -6
- data/lib/advanced_billing/models/offer_item.rb +7 -7
- data/lib/advanced_billing/models/offer_response.rb +4 -4
- data/lib/advanced_billing/models/offer_signup_page.rb +7 -7
- data/lib/advanced_billing/models/{reason_codes_json_response.rb → ok_response.rb} +7 -7
- data/lib/advanced_billing/models/on_off_component.rb +40 -61
- data/lib/advanced_billing/models/organization_address.rb +7 -7
- data/lib/advanced_billing/models/origin_invoice.rb +5 -5
- data/lib/advanced_billing/models/overage_pricing.rb +5 -5
- data/lib/advanced_billing/models/override_subscription.rb +7 -7
- data/lib/advanced_billing/models/override_subscription_request.rb +4 -4
- data/lib/advanced_billing/models/paginated_metadata.rb +7 -7
- data/lib/advanced_billing/models/paid_invoice.rb +7 -7
- data/lib/advanced_billing/models/pause_request.rb +4 -4
- data/lib/advanced_billing/models/payer_attributes.rb +7 -7
- data/lib/advanced_billing/models/payer_error.rb +6 -6
- data/lib/advanced_billing/models/payment_collection_method_changed.rb +5 -5
- data/lib/advanced_billing/models/payment_for_allocation.rb +7 -7
- data/lib/advanced_billing/models/payment_method_apple_pay.rb +4 -4
- data/lib/advanced_billing/models/payment_method_bank_account.rb +6 -6
- data/lib/advanced_billing/models/payment_method_credit_card.rb +7 -7
- data/lib/advanced_billing/models/payment_method_external.rb +7 -7
- data/lib/advanced_billing/models/payment_method_paypal.rb +5 -5
- data/lib/advanced_billing/models/payment_profile_attributes.rb +7 -7
- data/lib/advanced_billing/models/payment_profile_response.rb +4 -4
- data/lib/advanced_billing/models/payment_related_events.rb +5 -5
- data/lib/advanced_billing/models/paypal_payment_profile.rb +7 -7
- data/lib/advanced_billing/models/pending_cancellation_change.rb +5 -5
- data/lib/advanced_billing/models/portal_management_link.rb +7 -7
- data/lib/advanced_billing/models/prepaid_configuration.rb +7 -7
- data/lib/advanced_billing/models/prepaid_configuration_response.rb +4 -4
- data/lib/advanced_billing/models/prepaid_product_price_point_filter.rb +4 -4
- data/lib/advanced_billing/models/prepaid_subscription_balance_changed.rb +7 -7
- data/lib/advanced_billing/models/prepaid_usage.rb +7 -7
- data/lib/advanced_billing/models/prepaid_usage_allocation_detail.rb +6 -6
- data/lib/advanced_billing/models/prepaid_usage_component.rb +48 -41
- data/lib/advanced_billing/models/prepayment.rb +7 -7
- data/lib/advanced_billing/models/prepayment_account_balance_changed.rb +7 -7
- data/lib/advanced_billing/models/prepayment_response.rb +4 -4
- data/lib/advanced_billing/models/prepayments_response.rb +4 -4
- data/lib/advanced_billing/models/preview_allocations_request.rb +7 -7
- data/lib/advanced_billing/models/price.rb +6 -6
- data/lib/advanced_billing/models/product.rb +7 -7
- data/lib/advanced_billing/models/product_family.rb +7 -7
- data/lib/advanced_billing/models/product_family_response.rb +4 -4
- data/lib/advanced_billing/models/product_price_point.rb +7 -7
- data/lib/advanced_billing/models/product_price_point_errors.rb +7 -7
- data/lib/advanced_billing/models/product_price_point_response.rb +4 -4
- data/lib/advanced_billing/models/product_response.rb +4 -4
- data/lib/advanced_billing/models/proforma_error.rb +4 -4
- data/lib/advanced_billing/models/proforma_invoice.rb +7 -7
- data/lib/advanced_billing/models/proforma_invoice_credit.rb +7 -7
- data/lib/advanced_billing/models/proforma_invoice_discount.rb +7 -7
- data/lib/advanced_billing/models/proforma_invoice_issued.rb +7 -7
- data/lib/advanced_billing/models/proforma_invoice_payment.rb +7 -7
- data/lib/advanced_billing/models/proforma_invoice_tax.rb +7 -7
- data/lib/advanced_billing/models/proration.rb +4 -4
- data/lib/advanced_billing/models/public_key.rb +6 -6
- data/lib/advanced_billing/models/public_signup_page.rb +7 -7
- data/lib/advanced_billing/models/quantity_based_component.rb +21 -23
- data/lib/advanced_billing/models/reactivate_subscription_group_request.rb +5 -5
- data/lib/advanced_billing/models/reactivate_subscription_group_response.rb +7 -7
- data/lib/advanced_billing/models/reactivate_subscription_request.rb +7 -7
- data/lib/advanced_billing/models/reactivation_billing.rb +4 -4
- data/lib/advanced_billing/models/reason_code.rb +7 -7
- data/lib/advanced_billing/models/reason_code_response.rb +4 -4
- data/lib/advanced_billing/models/record_payment_request.rb +4 -4
- data/lib/advanced_billing/models/record_payment_response.rb +5 -5
- data/lib/advanced_billing/models/referral_code.rb +7 -7
- data/lib/advanced_billing/models/referral_validation_response.rb +4 -4
- data/lib/advanced_billing/models/refund_consolidated_invoice.rb +7 -7
- data/lib/advanced_billing/models/refund_invoice.rb +7 -7
- data/lib/advanced_billing/models/refund_invoice_event.rb +7 -7
- data/lib/advanced_billing/models/refund_invoice_event_data.rb +7 -7
- data/lib/advanced_billing/models/refund_invoice_request.rb +4 -4
- data/lib/advanced_billing/models/refund_prepayment.rb +7 -7
- data/lib/advanced_billing/models/refund_prepayment_base_refund_error.rb +4 -4
- data/lib/advanced_billing/models/refund_prepayment_request.rb +4 -4
- data/lib/advanced_billing/models/refund_success.rb +6 -6
- data/lib/advanced_billing/models/remove_payment_event.rb +7 -7
- data/lib/advanced_billing/models/remove_payment_event_data.rb +7 -7
- data/lib/advanced_billing/models/renewal_preview.rb +7 -7
- data/lib/advanced_billing/models/renewal_preview_component.rb +6 -6
- data/lib/advanced_billing/models/renewal_preview_line_item.rb +7 -7
- data/lib/advanced_billing/models/renewal_preview_request.rb +4 -4
- data/lib/advanced_billing/models/renewal_preview_response.rb +4 -4
- data/lib/advanced_billing/models/replay_webhooks_request.rb +4 -4
- data/lib/advanced_billing/models/replay_webhooks_response.rb +4 -4
- data/lib/advanced_billing/models/resent_invitation.rb +7 -7
- data/lib/advanced_billing/models/resume_options.rb +5 -5
- data/lib/advanced_billing/models/revoked_invitation.rb +6 -6
- data/lib/advanced_billing/models/sale_rep.rb +7 -7
- data/lib/advanced_billing/models/sale_rep_item_mrr.rb +6 -6
- data/lib/advanced_billing/models/sale_rep_settings.rb +7 -7
- data/lib/advanced_billing/models/sale_rep_subscription.rb +7 -7
- data/lib/advanced_billing/models/segment.rb +7 -7
- data/lib/advanced_billing/models/segment_price.rb +7 -7
- data/lib/advanced_billing/models/segment_response.rb +4 -4
- data/lib/advanced_billing/models/send_invoice_request.rb +6 -6
- data/lib/advanced_billing/models/service_credit.rb +7 -7
- data/lib/advanced_billing/models/service_credit_response.rb +4 -4
- data/lib/advanced_billing/models/signup_proforma_preview.rb +5 -5
- data/lib/advanced_billing/models/signup_proforma_preview_response.rb +4 -4
- data/lib/advanced_billing/models/site.rb +7 -7
- data/lib/advanced_billing/models/site_response.rb +4 -4
- data/lib/advanced_billing/models/site_statistics.rb +7 -7
- data/lib/advanced_billing/models/site_summary.rb +7 -7
- data/lib/advanced_billing/models/subscription.rb +7 -7
- data/lib/advanced_billing/models/subscription_component.rb +7 -7
- data/lib/advanced_billing/models/subscription_component_allocation_error_item.rb +5 -5
- data/lib/advanced_billing/models/subscription_component_response.rb +4 -4
- data/lib/advanced_billing/models/subscription_component_subscription.rb +5 -5
- data/lib/advanced_billing/models/subscription_custom_price.rb +7 -7
- data/lib/advanced_billing/models/subscription_filter.rb +7 -7
- data/lib/advanced_billing/models/subscription_group.rb +7 -7
- data/lib/advanced_billing/models/subscription_group_balances.rb +7 -7
- data/lib/advanced_billing/models/subscription_group_bank_account.rb +7 -7
- data/lib/advanced_billing/models/subscription_group_component_custom_price.rb +6 -6
- data/lib/advanced_billing/models/subscription_group_credit_card.rb +7 -7
- data/lib/advanced_billing/models/subscription_group_customer.rb +7 -7
- data/lib/advanced_billing/models/subscription_group_item.rb +7 -7
- data/lib/advanced_billing/models/subscription_group_members_array_error.rb +4 -4
- data/lib/advanced_billing/models/subscription_group_payment_profile.rb +7 -7
- data/lib/advanced_billing/models/subscription_group_prepayment.rb +7 -7
- data/lib/advanced_billing/models/subscription_group_prepayment_request.rb +4 -4
- data/lib/advanced_billing/models/subscription_group_prepayment_response.rb +7 -7
- data/lib/advanced_billing/models/subscription_group_response.rb +4 -4
- data/lib/advanced_billing/models/subscription_group_signup.rb +7 -7
- data/lib/advanced_billing/models/subscription_group_signup_component.rb +7 -7
- data/lib/advanced_billing/models/subscription_group_signup_error.rb +7 -7
- data/lib/advanced_billing/models/{subscription_group_signup_success.rb → subscription_group_signup_event_data.rb} +17 -15
- data/lib/advanced_billing/models/subscription_group_signup_failure_data.rb +7 -7
- data/lib/advanced_billing/models/subscription_group_signup_item.rb +7 -7
- data/lib/advanced_billing/models/subscription_group_signup_request.rb +4 -4
- data/lib/advanced_billing/models/subscription_group_signup_response.rb +7 -7
- data/lib/advanced_billing/models/subscription_group_single_error.rb +4 -4
- data/lib/advanced_billing/models/subscription_group_subscription_error.rb +7 -7
- data/lib/advanced_billing/models/subscription_group_update_error.rb +6 -15
- data/lib/advanced_billing/models/subscription_included_coupon.rb +7 -7
- data/lib/advanced_billing/models/subscription_migration_preview.rb +7 -7
- data/lib/advanced_billing/models/subscription_migration_preview_options.rb +7 -7
- data/lib/advanced_billing/models/subscription_migration_preview_request.rb +4 -4
- data/lib/advanced_billing/models/subscription_migration_preview_response.rb +4 -4
- data/lib/advanced_billing/models/subscription_mrr.rb +6 -6
- data/lib/advanced_billing/models/subscription_mrr_breakout.rb +5 -5
- data/lib/advanced_billing/models/subscription_mrr_response.rb +4 -4
- data/lib/advanced_billing/models/subscription_note.rb +7 -7
- data/lib/advanced_billing/models/subscription_note_response.rb +4 -4
- data/lib/advanced_billing/models/subscription_preview.rb +5 -5
- data/lib/advanced_billing/models/subscription_preview_response.rb +4 -4
- data/lib/advanced_billing/models/subscription_product_change.rb +5 -5
- data/lib/advanced_billing/models/subscription_product_migration.rb +7 -7
- data/lib/advanced_billing/models/subscription_product_migration_request.rb +4 -4
- data/lib/advanced_billing/models/subscription_response.rb +4 -4
- data/lib/advanced_billing/models/subscription_state_change.rb +5 -5
- data/lib/advanced_billing/models/tax_configuration.rb +6 -6
- data/lib/advanced_billing/models/too_many_management_link_requests.rb +5 -5
- data/lib/advanced_billing/models/update_allocation_expiration_date.rb +4 -4
- data/lib/advanced_billing/models/update_component.rb +7 -7
- data/lib/advanced_billing/models/update_component_price_point.rb +7 -7
- data/lib/advanced_billing/models/update_component_price_point_request.rb +4 -4
- data/lib/advanced_billing/models/update_component_request.rb +4 -4
- data/lib/advanced_billing/models/update_coupon_currency.rb +5 -5
- data/lib/advanced_billing/models/update_currency_price.rb +6 -6
- data/lib/advanced_billing/models/update_currency_prices_request.rb +4 -4
- data/lib/advanced_billing/models/update_customer.rb +7 -7
- data/lib/advanced_billing/models/update_customer_request.rb +4 -4
- data/lib/advanced_billing/models/update_metadata.rb +6 -6
- data/lib/advanced_billing/models/update_metadata_request.rb +4 -4
- data/lib/advanced_billing/models/update_metafield.rb +7 -7
- data/lib/advanced_billing/models/update_metafields_request.rb +4 -4
- data/lib/advanced_billing/models/update_payment_profile.rb +7 -7
- data/lib/advanced_billing/models/update_payment_profile_request.rb +4 -4
- data/lib/advanced_billing/models/update_price.rb +7 -7
- data/lib/advanced_billing/models/update_product_price_point.rb +5 -5
- data/lib/advanced_billing/models/update_product_price_point_request.rb +4 -4
- data/lib/advanced_billing/models/update_reason_code.rb +6 -6
- data/lib/advanced_billing/models/update_reason_code_request.rb +4 -4
- data/lib/advanced_billing/models/update_segment.rb +5 -5
- data/lib/advanced_billing/models/update_segment_request.rb +4 -4
- data/lib/advanced_billing/models/update_subscription.rb +31 -8
- data/lib/advanced_billing/models/update_subscription_component.rb +5 -5
- data/lib/advanced_billing/models/update_subscription_group.rb +4 -4
- data/lib/advanced_billing/models/update_subscription_group_request.rb +4 -4
- data/lib/advanced_billing/models/update_subscription_note.rb +5 -5
- data/lib/advanced_billing/models/update_subscription_note_request.rb +4 -4
- data/lib/advanced_billing/models/update_subscription_request.rb +4 -4
- data/lib/advanced_billing/models/upsert_prepaid_configuration.rb +7 -7
- data/lib/advanced_billing/models/upsert_prepaid_configuration_request.rb +4 -4
- data/lib/advanced_billing/models/usage.rb +7 -7
- data/lib/advanced_billing/models/usage_response.rb +4 -4
- data/lib/advanced_billing/models/void_invoice.rb +4 -4
- data/lib/advanced_billing/models/void_invoice_event.rb +7 -7
- data/lib/advanced_billing/models/void_invoice_event_data.rb +7 -7
- data/lib/advanced_billing/models/void_invoice_request.rb +4 -4
- data/lib/advanced_billing/models/void_remainder_event.rb +7 -7
- data/lib/advanced_billing/models/void_remainder_event_data.rb +7 -7
- data/lib/advanced_billing/models/webhook.rb +7 -7
- data/lib/advanced_billing/models/webhook_response.rb +4 -4
- data/lib/advanced_billing/utilities/union_type_lookup.rb +12 -33
- data/lib/advanced_billing.rb +9 -11
- metadata +12 -14
- data/lib/advanced_billing/models/create_or_update_flat_amount_coupon.rb +0 -249
- data/lib/advanced_billing/models/create_or_update_percentage_coupon.rb +0 -250
- data/lib/advanced_billing/models/event_type.rb +0 -121
- data/lib/advanced_billing/models/prepaid_component_price_point.rb +0 -123
- data/lib/advanced_billing/models/subscription_group_member_error.rb +0 -78
- data/lib/advanced_billing/models/subscription_group_signup_failure.rb +0 -93
- data/lib/advanced_billing/models/subscription_group_signup_success_data.rb +0 -185
@@ -0,0 +1,244 @@
|
|
1
|
+
# advanced_billing
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module AdvancedBilling
|
7
|
+
# CouponPayload Model.
|
8
|
+
class CouponPayload < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# Required when creating a new coupon. This name is not displayed to
|
13
|
+
# customers and is limited to 255 characters.
|
14
|
+
# @return [String]
|
15
|
+
attr_accessor :name
|
16
|
+
|
17
|
+
# Required when creating a new coupon. The code is limited to 255
|
18
|
+
# characters. May contain uppercase alphanumeric characters and these
|
19
|
+
# special characters (which allow for email addresses to be used): “%”, “@”,
|
20
|
+
# “+”, “-”, “_”, and “.”
|
21
|
+
# @return [String]
|
22
|
+
attr_accessor :code
|
23
|
+
|
24
|
+
# Required when creating a new coupon. A description of the coupon that can
|
25
|
+
# be displayed to customers in transactions and on statements. The
|
26
|
+
# description is limited to 255 characters.
|
27
|
+
# @return [String]
|
28
|
+
attr_accessor :description
|
29
|
+
|
30
|
+
# Required when creating a new percentage coupon. Can't be used together
|
31
|
+
# with amount_in_cents. Percentage discount
|
32
|
+
# @return [Object]
|
33
|
+
attr_accessor :percentage
|
34
|
+
|
35
|
+
# Required when creating a new flat amount coupon. Can't be used together
|
36
|
+
# with percentage. Flat USD discount
|
37
|
+
# @return [Integer]
|
38
|
+
attr_accessor :amount_in_cents
|
39
|
+
|
40
|
+
# If set to true, discount is not limited (credits will carry forward to
|
41
|
+
# next billing). Can't be used together with restrictions.
|
42
|
+
# @return [TrueClass | FalseClass]
|
43
|
+
attr_accessor :allow_negative_balance
|
44
|
+
|
45
|
+
# If set to true, discount is not limited (credits will carry forward to
|
46
|
+
# next billing). Can't be used together with restrictions.
|
47
|
+
# @return [TrueClass | FalseClass]
|
48
|
+
attr_accessor :recurring
|
49
|
+
|
50
|
+
# After the end of the given day, this coupon code will be invalid for new
|
51
|
+
# signups. Recurring discounts started before this date will continue to
|
52
|
+
# recur even after this date.
|
53
|
+
# @return [Date]
|
54
|
+
attr_accessor :end_date
|
55
|
+
|
56
|
+
# After the end of the given day, this coupon code will be invalid for new
|
57
|
+
# signups. Recurring discounts started before this date will continue to
|
58
|
+
# recur even after this date.
|
59
|
+
# @return [String]
|
60
|
+
attr_accessor :product_family_id
|
61
|
+
|
62
|
+
# A stackable coupon can be combined with other coupons on a Subscription.
|
63
|
+
# @return [TrueClass | FalseClass]
|
64
|
+
attr_accessor :stackable
|
65
|
+
|
66
|
+
# Applicable only to stackable coupons. For `compound`, Percentage-based
|
67
|
+
# discounts will be calculated against the remaining price, after prior
|
68
|
+
# discounts have been calculated. For `full-price`, Percentage-based
|
69
|
+
# discounts will always be calculated against the original item price,
|
70
|
+
# before other discounts are applied.
|
71
|
+
# @return [CompoundingStrategy]
|
72
|
+
attr_accessor :compounding_strategy
|
73
|
+
|
74
|
+
# Applicable only to stackable coupons. For `compound`, Percentage-based
|
75
|
+
# discounts will be calculated against the remaining price, after prior
|
76
|
+
# discounts have been calculated. For `full-price`, Percentage-based
|
77
|
+
# discounts will always be calculated against the original item price,
|
78
|
+
# before other discounts are applied.
|
79
|
+
# @return [TrueClass | FalseClass]
|
80
|
+
attr_accessor :exclude_mid_period_allocations
|
81
|
+
|
82
|
+
# Applicable only to stackable coupons. For `compound`, Percentage-based
|
83
|
+
# discounts will be calculated against the remaining price, after prior
|
84
|
+
# discounts have been calculated. For `full-price`, Percentage-based
|
85
|
+
# discounts will always be calculated against the original item price,
|
86
|
+
# before other discounts are applied.
|
87
|
+
# @return [TrueClass | FalseClass]
|
88
|
+
attr_accessor :apply_on_cancel_at_end_of_period
|
89
|
+
|
90
|
+
# Applicable only to stackable coupons. For `compound`, Percentage-based
|
91
|
+
# discounts will be calculated against the remaining price, after prior
|
92
|
+
# discounts have been calculated. For `full-price`, Percentage-based
|
93
|
+
# discounts will always be calculated against the original item price,
|
94
|
+
# before other discounts are applied.
|
95
|
+
# @return [TrueClass | FalseClass]
|
96
|
+
attr_accessor :apply_on_subscription_expiration
|
97
|
+
|
98
|
+
# A mapping from model property names to API property names.
|
99
|
+
def self.names
|
100
|
+
@_hash = {} if @_hash.nil?
|
101
|
+
@_hash['name'] = 'name'
|
102
|
+
@_hash['code'] = 'code'
|
103
|
+
@_hash['description'] = 'description'
|
104
|
+
@_hash['percentage'] = 'percentage'
|
105
|
+
@_hash['amount_in_cents'] = 'amount_in_cents'
|
106
|
+
@_hash['allow_negative_balance'] = 'allow_negative_balance'
|
107
|
+
@_hash['recurring'] = 'recurring'
|
108
|
+
@_hash['end_date'] = 'end_date'
|
109
|
+
@_hash['product_family_id'] = 'product_family_id'
|
110
|
+
@_hash['stackable'] = 'stackable'
|
111
|
+
@_hash['compounding_strategy'] = 'compounding_strategy'
|
112
|
+
@_hash['exclude_mid_period_allocations'] =
|
113
|
+
'exclude_mid_period_allocations'
|
114
|
+
@_hash['apply_on_cancel_at_end_of_period'] =
|
115
|
+
'apply_on_cancel_at_end_of_period'
|
116
|
+
@_hash['apply_on_subscription_expiration'] =
|
117
|
+
'apply_on_subscription_expiration'
|
118
|
+
@_hash
|
119
|
+
end
|
120
|
+
|
121
|
+
# An array for optional fields
|
122
|
+
def self.optionals
|
123
|
+
%w[
|
124
|
+
name
|
125
|
+
code
|
126
|
+
description
|
127
|
+
percentage
|
128
|
+
amount_in_cents
|
129
|
+
allow_negative_balance
|
130
|
+
recurring
|
131
|
+
end_date
|
132
|
+
product_family_id
|
133
|
+
stackable
|
134
|
+
compounding_strategy
|
135
|
+
exclude_mid_period_allocations
|
136
|
+
apply_on_cancel_at_end_of_period
|
137
|
+
apply_on_subscription_expiration
|
138
|
+
]
|
139
|
+
end
|
140
|
+
|
141
|
+
# An array for nullable fields
|
142
|
+
def self.nullables
|
143
|
+
[]
|
144
|
+
end
|
145
|
+
|
146
|
+
def initialize(name: SKIP, code: SKIP, description: SKIP, percentage: SKIP,
|
147
|
+
amount_in_cents: SKIP, allow_negative_balance: SKIP,
|
148
|
+
recurring: SKIP, end_date: SKIP, product_family_id: SKIP,
|
149
|
+
stackable: SKIP, compounding_strategy: SKIP,
|
150
|
+
exclude_mid_period_allocations: SKIP,
|
151
|
+
apply_on_cancel_at_end_of_period: SKIP,
|
152
|
+
apply_on_subscription_expiration: SKIP,
|
153
|
+
additional_properties: {})
|
154
|
+
# Add additional model properties to the instance.
|
155
|
+
additional_properties.each do |_name, _value|
|
156
|
+
instance_variable_set("@#{_name}", _value)
|
157
|
+
end
|
158
|
+
|
159
|
+
@name = name unless name == SKIP
|
160
|
+
@code = code unless code == SKIP
|
161
|
+
@description = description unless description == SKIP
|
162
|
+
@percentage = percentage unless percentage == SKIP
|
163
|
+
@amount_in_cents = amount_in_cents unless amount_in_cents == SKIP
|
164
|
+
@allow_negative_balance = allow_negative_balance unless allow_negative_balance == SKIP
|
165
|
+
@recurring = recurring unless recurring == SKIP
|
166
|
+
@end_date = end_date unless end_date == SKIP
|
167
|
+
@product_family_id = product_family_id unless product_family_id == SKIP
|
168
|
+
@stackable = stackable unless stackable == SKIP
|
169
|
+
@compounding_strategy = compounding_strategy unless compounding_strategy == SKIP
|
170
|
+
unless exclude_mid_period_allocations == SKIP
|
171
|
+
@exclude_mid_period_allocations =
|
172
|
+
exclude_mid_period_allocations
|
173
|
+
end
|
174
|
+
unless apply_on_cancel_at_end_of_period == SKIP
|
175
|
+
@apply_on_cancel_at_end_of_period =
|
176
|
+
apply_on_cancel_at_end_of_period
|
177
|
+
end
|
178
|
+
unless apply_on_subscription_expiration == SKIP
|
179
|
+
@apply_on_subscription_expiration =
|
180
|
+
apply_on_subscription_expiration
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
# Creates an instance of the object from a hash.
|
185
|
+
def self.from_hash(hash)
|
186
|
+
return nil unless hash
|
187
|
+
|
188
|
+
# Extract variables from the hash.
|
189
|
+
name = hash.key?('name') ? hash['name'] : SKIP
|
190
|
+
code = hash.key?('code') ? hash['code'] : SKIP
|
191
|
+
description = hash.key?('description') ? hash['description'] : SKIP
|
192
|
+
percentage = hash.key?('percentage') ? APIHelper.deserialize_union_type(
|
193
|
+
UnionTypeLookUp.get(:CouponPayloadPercentage), hash['percentage']
|
194
|
+
) : SKIP
|
195
|
+
amount_in_cents =
|
196
|
+
hash.key?('amount_in_cents') ? hash['amount_in_cents'] : SKIP
|
197
|
+
allow_negative_balance =
|
198
|
+
hash.key?('allow_negative_balance') ? hash['allow_negative_balance'] : SKIP
|
199
|
+
recurring = hash.key?('recurring') ? hash['recurring'] : SKIP
|
200
|
+
end_date = hash.key?('end_date') ? hash['end_date'] : SKIP
|
201
|
+
product_family_id =
|
202
|
+
hash.key?('product_family_id') ? hash['product_family_id'] : SKIP
|
203
|
+
stackable = hash.key?('stackable') ? hash['stackable'] : SKIP
|
204
|
+
compounding_strategy =
|
205
|
+
hash.key?('compounding_strategy') ? hash['compounding_strategy'] : SKIP
|
206
|
+
exclude_mid_period_allocations =
|
207
|
+
hash.key?('exclude_mid_period_allocations') ? hash['exclude_mid_period_allocations'] : SKIP
|
208
|
+
apply_on_cancel_at_end_of_period =
|
209
|
+
hash.key?('apply_on_cancel_at_end_of_period') ? hash['apply_on_cancel_at_end_of_period'] : SKIP
|
210
|
+
apply_on_subscription_expiration =
|
211
|
+
hash.key?('apply_on_subscription_expiration') ? hash['apply_on_subscription_expiration'] : SKIP
|
212
|
+
|
213
|
+
# Clean out expected properties from Hash.
|
214
|
+
additional_properties = hash.reject { |k, _| names.value?(k) }
|
215
|
+
|
216
|
+
# Create object from extracted values.
|
217
|
+
CouponPayload.new(name: name,
|
218
|
+
code: code,
|
219
|
+
description: description,
|
220
|
+
percentage: percentage,
|
221
|
+
amount_in_cents: amount_in_cents,
|
222
|
+
allow_negative_balance: allow_negative_balance,
|
223
|
+
recurring: recurring,
|
224
|
+
end_date: end_date,
|
225
|
+
product_family_id: product_family_id,
|
226
|
+
stackable: stackable,
|
227
|
+
compounding_strategy: compounding_strategy,
|
228
|
+
exclude_mid_period_allocations: exclude_mid_period_allocations,
|
229
|
+
apply_on_cancel_at_end_of_period: apply_on_cancel_at_end_of_period,
|
230
|
+
apply_on_subscription_expiration: apply_on_subscription_expiration,
|
231
|
+
additional_properties: additional_properties)
|
232
|
+
end
|
233
|
+
|
234
|
+
# Validates an instance of the object from a given value.
|
235
|
+
# @param [CouponPayload | Hash] The value against the validation is performed.
|
236
|
+
def self.validate(value)
|
237
|
+
return true if value.instance_of? self
|
238
|
+
|
239
|
+
return false unless value.instance_of? Hash
|
240
|
+
|
241
|
+
true
|
242
|
+
end
|
243
|
+
end
|
244
|
+
end
|
@@ -4,13 +4,13 @@
|
|
4
4
|
# ( https://apimatic.io ).
|
5
5
|
|
6
6
|
module AdvancedBilling
|
7
|
-
#
|
8
|
-
class
|
7
|
+
# CouponRequest Model.
|
8
|
+
class CouponRequest < BaseModel
|
9
9
|
SKIP = Object.new
|
10
10
|
private_constant :SKIP
|
11
11
|
|
12
12
|
# TODO: Write general description for this method
|
13
|
-
# @return [
|
13
|
+
# @return [CouponPayload]
|
14
14
|
attr_accessor :coupon
|
15
15
|
|
16
16
|
# An object where the keys are product_ids and the values are booleans
|
@@ -48,14 +48,14 @@ module AdvancedBilling
|
|
48
48
|
|
49
49
|
def initialize(coupon: SKIP, restricted_products: SKIP,
|
50
50
|
restricted_components: SKIP, additional_properties: {})
|
51
|
-
@coupon = coupon unless coupon == SKIP
|
52
|
-
@restricted_products = restricted_products unless restricted_products == SKIP
|
53
|
-
@restricted_components = restricted_components unless restricted_components == SKIP
|
54
|
-
|
55
51
|
# Add additional model properties to the instance.
|
56
52
|
additional_properties.each do |_name, _value|
|
57
53
|
instance_variable_set("@#{_name}", _value)
|
58
54
|
end
|
55
|
+
|
56
|
+
@coupon = coupon unless coupon == SKIP
|
57
|
+
@restricted_products = restricted_products unless restricted_products == SKIP
|
58
|
+
@restricted_components = restricted_components unless restricted_components == SKIP
|
59
59
|
end
|
60
60
|
|
61
61
|
# Creates an instance of the object from a hash.
|
@@ -63,32 +63,20 @@ module AdvancedBilling
|
|
63
63
|
return nil unless hash
|
64
64
|
|
65
65
|
# Extract variables from the hash.
|
66
|
-
coupon =
|
67
|
-
UnionTypeLookUp.get(:CreateOrUpdateCouponCoupon), hash['coupon']
|
68
|
-
) : SKIP
|
66
|
+
coupon = CouponPayload.from_hash(hash['coupon']) if hash['coupon']
|
69
67
|
restricted_products =
|
70
68
|
hash.key?('restricted_products') ? hash['restricted_products'] : SKIP
|
71
69
|
restricted_components =
|
72
70
|
hash.key?('restricted_components') ? hash['restricted_components'] : SKIP
|
73
71
|
|
74
72
|
# Clean out expected properties from Hash.
|
75
|
-
|
73
|
+
additional_properties = hash.reject { |k, _| names.value?(k) }
|
76
74
|
|
77
75
|
# Create object from extracted values.
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
end
|
83
|
-
|
84
|
-
# Validates an instance of the object from a given value.
|
85
|
-
# @param [CreateOrUpdateCoupon | Hash] The value against the validation is performed.
|
86
|
-
def self.validate(value)
|
87
|
-
return true if value.instance_of? self
|
88
|
-
|
89
|
-
return false unless value.instance_of? Hash
|
90
|
-
|
91
|
-
true
|
76
|
+
CouponRequest.new(coupon: coupon,
|
77
|
+
restricted_products: restricted_products,
|
78
|
+
restricted_components: restricted_components,
|
79
|
+
additional_properties: additional_properties)
|
92
80
|
end
|
93
81
|
end
|
94
82
|
end
|
@@ -33,12 +33,12 @@ module AdvancedBilling
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def initialize(coupon: SKIP, additional_properties: {})
|
36
|
-
@coupon = coupon unless coupon == SKIP
|
37
|
-
|
38
36
|
# Add additional model properties to the instance.
|
39
37
|
additional_properties.each do |_name, _value|
|
40
38
|
instance_variable_set("@#{_name}", _value)
|
41
39
|
end
|
40
|
+
|
41
|
+
@coupon = coupon unless coupon == SKIP
|
42
42
|
end
|
43
43
|
|
44
44
|
# Creates an instance of the object from a hash.
|
@@ -49,11 +49,11 @@ module AdvancedBilling
|
|
49
49
|
coupon = Coupon.from_hash(hash['coupon']) if hash['coupon']
|
50
50
|
|
51
51
|
# Clean out expected properties from Hash.
|
52
|
-
|
52
|
+
additional_properties = hash.reject { |k, _| names.value?(k) }
|
53
53
|
|
54
54
|
# Create object from extracted values.
|
55
55
|
CouponResponse.new(coupon: coupon,
|
56
|
-
additional_properties:
|
56
|
+
additional_properties: additional_properties)
|
57
57
|
end
|
58
58
|
end
|
59
59
|
end
|
@@ -60,16 +60,16 @@ module AdvancedBilling
|
|
60
60
|
|
61
61
|
def initialize(id: SKIP, item_type: SKIP, item_id: SKIP, name: SKIP,
|
62
62
|
handle: SKIP, additional_properties: {})
|
63
|
+
# Add additional model properties to the instance.
|
64
|
+
additional_properties.each do |_name, _value|
|
65
|
+
instance_variable_set("@#{_name}", _value)
|
66
|
+
end
|
67
|
+
|
63
68
|
@id = id unless id == SKIP
|
64
69
|
@item_type = item_type unless item_type == SKIP
|
65
70
|
@item_id = item_id unless item_id == SKIP
|
66
71
|
@name = name unless name == SKIP
|
67
72
|
@handle = handle unless handle == SKIP
|
68
|
-
|
69
|
-
# Add additional model properties to the instance.
|
70
|
-
additional_properties.each do |_name, _value|
|
71
|
-
instance_variable_set("@#{_name}", _value)
|
72
|
-
end
|
73
73
|
end
|
74
74
|
|
75
75
|
# Creates an instance of the object from a hash.
|
@@ -84,7 +84,7 @@ module AdvancedBilling
|
|
84
84
|
handle = hash.key?('handle') ? hash['handle'] : SKIP
|
85
85
|
|
86
86
|
# Clean out expected properties from Hash.
|
87
|
-
|
87
|
+
additional_properties = hash.reject { |k, _| names.value?(k) }
|
88
88
|
|
89
89
|
# Create object from extracted values.
|
90
90
|
CouponRestriction.new(id: id,
|
@@ -92,7 +92,7 @@ module AdvancedBilling
|
|
92
92
|
item_id: item_id,
|
93
93
|
name: name,
|
94
94
|
handle: handle,
|
95
|
-
additional_properties:
|
95
|
+
additional_properties: additional_properties)
|
96
96
|
end
|
97
97
|
end
|
98
98
|
end
|
@@ -33,12 +33,12 @@ module AdvancedBilling
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def initialize(codes: SKIP, additional_properties: {})
|
36
|
-
@codes = codes unless codes == SKIP
|
37
|
-
|
38
36
|
# Add additional model properties to the instance.
|
39
37
|
additional_properties.each do |_name, _value|
|
40
38
|
instance_variable_set("@#{_name}", _value)
|
41
39
|
end
|
40
|
+
|
41
|
+
@codes = codes unless codes == SKIP
|
42
42
|
end
|
43
43
|
|
44
44
|
# Creates an instance of the object from a hash.
|
@@ -49,11 +49,11 @@ module AdvancedBilling
|
|
49
49
|
codes = hash.key?('codes') ? hash['codes'] : SKIP
|
50
50
|
|
51
51
|
# Clean out expected properties from Hash.
|
52
|
-
|
52
|
+
additional_properties = hash.reject { |k, _| names.value?(k) }
|
53
53
|
|
54
54
|
# Create object from extracted values.
|
55
55
|
CouponSubcodes.new(codes: codes,
|
56
|
-
additional_properties:
|
56
|
+
additional_properties: additional_properties)
|
57
57
|
end
|
58
58
|
end
|
59
59
|
end
|
@@ -46,14 +46,14 @@ module AdvancedBilling
|
|
46
46
|
|
47
47
|
def initialize(created_codes: SKIP, duplicate_codes: SKIP,
|
48
48
|
invalid_codes: SKIP, additional_properties: {})
|
49
|
-
@created_codes = created_codes unless created_codes == SKIP
|
50
|
-
@duplicate_codes = duplicate_codes unless duplicate_codes == SKIP
|
51
|
-
@invalid_codes = invalid_codes unless invalid_codes == SKIP
|
52
|
-
|
53
49
|
# Add additional model properties to the instance.
|
54
50
|
additional_properties.each do |_name, _value|
|
55
51
|
instance_variable_set("@#{_name}", _value)
|
56
52
|
end
|
53
|
+
|
54
|
+
@created_codes = created_codes unless created_codes == SKIP
|
55
|
+
@duplicate_codes = duplicate_codes unless duplicate_codes == SKIP
|
56
|
+
@invalid_codes = invalid_codes unless invalid_codes == SKIP
|
57
57
|
end
|
58
58
|
|
59
59
|
# Creates an instance of the object from a hash.
|
@@ -67,13 +67,13 @@ module AdvancedBilling
|
|
67
67
|
invalid_codes = hash.key?('invalid_codes') ? hash['invalid_codes'] : SKIP
|
68
68
|
|
69
69
|
# Clean out expected properties from Hash.
|
70
|
-
|
70
|
+
additional_properties = hash.reject { |k, _| names.value?(k) }
|
71
71
|
|
72
72
|
# Create object from extracted values.
|
73
73
|
CouponSubcodesResponse.new(created_codes: created_codes,
|
74
74
|
duplicate_codes: duplicate_codes,
|
75
75
|
invalid_codes: invalid_codes,
|
76
|
-
additional_properties:
|
76
|
+
additional_properties: additional_properties)
|
77
77
|
end
|
78
78
|
end
|
79
79
|
end
|
@@ -77,6 +77,11 @@ module AdvancedBilling
|
|
77
77
|
def initialize(id: SKIP, name: SKIP, signups: SKIP, savings: SKIP,
|
78
78
|
savings_in_cents: SKIP, revenue: SKIP,
|
79
79
|
revenue_in_cents: SKIP, additional_properties: {})
|
80
|
+
# Add additional model properties to the instance.
|
81
|
+
additional_properties.each do |_name, _value|
|
82
|
+
instance_variable_set("@#{_name}", _value)
|
83
|
+
end
|
84
|
+
|
80
85
|
@id = id unless id == SKIP
|
81
86
|
@name = name unless name == SKIP
|
82
87
|
@signups = signups unless signups == SKIP
|
@@ -84,11 +89,6 @@ module AdvancedBilling
|
|
84
89
|
@savings_in_cents = savings_in_cents unless savings_in_cents == SKIP
|
85
90
|
@revenue = revenue unless revenue == SKIP
|
86
91
|
@revenue_in_cents = revenue_in_cents unless revenue_in_cents == SKIP
|
87
|
-
|
88
|
-
# Add additional model properties to the instance.
|
89
|
-
additional_properties.each do |_name, _value|
|
90
|
-
instance_variable_set("@#{_name}", _value)
|
91
|
-
end
|
92
92
|
end
|
93
93
|
|
94
94
|
# Creates an instance of the object from a hash.
|
@@ -107,7 +107,7 @@ module AdvancedBilling
|
|
107
107
|
hash.key?('revenue_in_cents') ? hash['revenue_in_cents'] : SKIP
|
108
108
|
|
109
109
|
# Clean out expected properties from Hash.
|
110
|
-
|
110
|
+
additional_properties = hash.reject { |k, _| names.value?(k) }
|
111
111
|
|
112
112
|
# Create object from extracted values.
|
113
113
|
CouponUsage.new(id: id,
|
@@ -117,7 +117,7 @@ module AdvancedBilling
|
|
117
117
|
savings_in_cents: savings_in_cents,
|
118
118
|
revenue: revenue,
|
119
119
|
revenue_in_cents: revenue_in_cents,
|
120
|
-
additional_properties:
|
120
|
+
additional_properties: additional_properties)
|
121
121
|
end
|
122
122
|
end
|
123
123
|
end
|
@@ -121,6 +121,11 @@ module AdvancedBilling
|
|
121
121
|
downgrade_credit: SKIP, upgrade_charge: SKIP,
|
122
122
|
initiate_dunning: SKIP, price_point_id: SKIP,
|
123
123
|
billing_schedule: SKIP, additional_properties: {})
|
124
|
+
# Add additional model properties to the instance.
|
125
|
+
additional_properties.each do |_name, _value|
|
126
|
+
instance_variable_set("@#{_name}", _value)
|
127
|
+
end
|
128
|
+
|
124
129
|
@quantity = quantity
|
125
130
|
@component_id = component_id unless component_id == SKIP
|
126
131
|
@memo = memo unless memo == SKIP
|
@@ -135,11 +140,6 @@ module AdvancedBilling
|
|
135
140
|
@initiate_dunning = initiate_dunning unless initiate_dunning == SKIP
|
136
141
|
@price_point_id = price_point_id unless price_point_id == SKIP
|
137
142
|
@billing_schedule = billing_schedule unless billing_schedule == SKIP
|
138
|
-
|
139
|
-
# Add additional model properties to the instance.
|
140
|
-
additional_properties.each do |_name, _value|
|
141
|
-
instance_variable_set("@#{_name}", _value)
|
142
|
-
end
|
143
143
|
end
|
144
144
|
|
145
145
|
# Creates an instance of the object from a hash.
|
@@ -168,7 +168,7 @@ module AdvancedBilling
|
|
168
168
|
hash['billing_schedule']
|
169
169
|
|
170
170
|
# Clean out expected properties from Hash.
|
171
|
-
|
171
|
+
additional_properties = hash.reject { |k, _| names.value?(k) }
|
172
172
|
|
173
173
|
# Create object from extracted values.
|
174
174
|
CreateAllocation.new(quantity: quantity,
|
@@ -182,7 +182,7 @@ module AdvancedBilling
|
|
182
182
|
initiate_dunning: initiate_dunning,
|
183
183
|
price_point_id: price_point_id,
|
184
184
|
billing_schedule: billing_schedule,
|
185
|
-
additional_properties:
|
185
|
+
additional_properties: additional_properties)
|
186
186
|
end
|
187
187
|
|
188
188
|
# Validates an instance of the object from a given value.
|
@@ -31,12 +31,12 @@ module AdvancedBilling
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def initialize(allocation:, additional_properties: {})
|
34
|
-
@allocation = allocation
|
35
|
-
|
36
34
|
# Add additional model properties to the instance.
|
37
35
|
additional_properties.each do |_name, _value|
|
38
36
|
instance_variable_set("@#{_name}", _value)
|
39
37
|
end
|
38
|
+
|
39
|
+
@allocation = allocation
|
40
40
|
end
|
41
41
|
|
42
42
|
# Creates an instance of the object from a hash.
|
@@ -47,11 +47,11 @@ module AdvancedBilling
|
|
47
47
|
allocation = CreateAllocation.from_hash(hash['allocation']) if hash['allocation']
|
48
48
|
|
49
49
|
# Clean out expected properties from Hash.
|
50
|
-
|
50
|
+
additional_properties = hash.reject { |k, _| names.value?(k) }
|
51
51
|
|
52
52
|
# Create object from extracted values.
|
53
53
|
CreateAllocationRequest.new(allocation: allocation,
|
54
|
-
additional_properties:
|
54
|
+
additional_properties: additional_properties)
|
55
55
|
end
|
56
56
|
end
|
57
57
|
end
|
@@ -30,11 +30,13 @@ module AdvancedBilling
|
|
30
30
|
attr_accessor :prices
|
31
31
|
|
32
32
|
# Whether to use the site level exchange rate or define your own prices for
|
33
|
-
# each currency if you have multiple currencies defined on the site.
|
33
|
+
# each currency if you have multiple currencies defined on the site. Setting
|
34
|
+
# not supported when creating price points in bulk.
|
34
35
|
# @return [TrueClass | FalseClass]
|
35
36
|
attr_accessor :use_site_exchange_rate
|
36
37
|
|
37
|
-
# Whether or not the price point includes tax
|
38
|
+
# Whether or not the price point includes tax. Setting not supported when
|
39
|
+
# creating price points in bulk.
|
38
40
|
# @return [TrueClass | FalseClass]
|
39
41
|
attr_accessor :tax_included
|
40
42
|
|
@@ -87,6 +89,11 @@ module AdvancedBilling
|
|
87
89
|
use_site_exchange_rate: true, tax_included: SKIP,
|
88
90
|
interval: SKIP, interval_unit: SKIP,
|
89
91
|
additional_properties: {})
|
92
|
+
# Add additional model properties to the instance.
|
93
|
+
additional_properties.each do |_name, _value|
|
94
|
+
instance_variable_set("@#{_name}", _value)
|
95
|
+
end
|
96
|
+
|
90
97
|
@name = name
|
91
98
|
@handle = handle unless handle == SKIP
|
92
99
|
@pricing_scheme = pricing_scheme
|
@@ -95,11 +102,6 @@ module AdvancedBilling
|
|
95
102
|
@tax_included = tax_included unless tax_included == SKIP
|
96
103
|
@interval = interval unless interval == SKIP
|
97
104
|
@interval_unit = interval_unit unless interval_unit == SKIP
|
98
|
-
|
99
|
-
# Add additional model properties to the instance.
|
100
|
-
additional_properties.each do |_name, _value|
|
101
|
-
instance_variable_set("@#{_name}", _value)
|
102
|
-
end
|
103
105
|
end
|
104
106
|
|
105
107
|
# Creates an instance of the object from a hash.
|
@@ -127,7 +129,7 @@ module AdvancedBilling
|
|
127
129
|
interval_unit = hash.key?('interval_unit') ? hash['interval_unit'] : SKIP
|
128
130
|
|
129
131
|
# Clean out expected properties from Hash.
|
130
|
-
|
132
|
+
additional_properties = hash.reject { |k, _| names.value?(k) }
|
131
133
|
|
132
134
|
# Create object from extracted values.
|
133
135
|
CreateComponentPricePoint.new(name: name,
|
@@ -138,7 +140,7 @@ module AdvancedBilling
|
|
138
140
|
tax_included: tax_included,
|
139
141
|
interval: interval,
|
140
142
|
interval_unit: interval_unit,
|
141
|
-
additional_properties:
|
143
|
+
additional_properties: additional_properties)
|
142
144
|
end
|
143
145
|
|
144
146
|
# Validates an instance of the object from a given value.
|
@@ -31,12 +31,12 @@ module AdvancedBilling
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def initialize(price_point:, additional_properties: {})
|
34
|
-
@price_point = price_point
|
35
|
-
|
36
34
|
# Add additional model properties to the instance.
|
37
35
|
additional_properties.each do |_name, _value|
|
38
36
|
instance_variable_set("@#{_name}", _value)
|
39
37
|
end
|
38
|
+
|
39
|
+
@price_point = price_point
|
40
40
|
end
|
41
41
|
|
42
42
|
# Creates an instance of the object from a hash.
|
@@ -49,11 +49,11 @@ module AdvancedBilling
|
|
49
49
|
) : nil
|
50
50
|
|
51
51
|
# Clean out expected properties from Hash.
|
52
|
-
|
52
|
+
additional_properties = hash.reject { |k, _| names.value?(k) }
|
53
53
|
|
54
54
|
# Create object from extracted values.
|
55
55
|
CreateComponentPricePointRequest.new(price_point: price_point,
|
56
|
-
additional_properties:
|
56
|
+
additional_properties: additional_properties)
|
57
57
|
end
|
58
58
|
|
59
59
|
# Validates an instance of the object from a given value.
|