orb-apiamtic-sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +177 -0
- data/bin/console +15 -0
- data/lib/api_reference/api_helper.rb +10 -0
- data/lib/api_reference/apis/alert_api.rb +497 -0
- data/lib/api_reference/apis/availability_api.rb +51 -0
- data/lib/api_reference/apis/base_api.rb +65 -0
- data/lib/api_reference/apis/coupon_api.rb +250 -0
- data/lib/api_reference/apis/credit_api.rb +1269 -0
- data/lib/api_reference/apis/credit_note_api.rb +181 -0
- data/lib/api_reference/apis/customer_api.rb +1058 -0
- data/lib/api_reference/apis/dimensional_price_group_api.rb +289 -0
- data/lib/api_reference/apis/event_api.rb +776 -0
- data/lib/api_reference/apis/invoice_api.rb +933 -0
- data/lib/api_reference/apis/item_api.rb +224 -0
- data/lib/api_reference/apis/license_api.rb +452 -0
- data/lib/api_reference/apis/license_type_api.rb +147 -0
- data/lib/api_reference/apis/metric_api.rb +211 -0
- data/lib/api_reference/apis/plan_api.rb +763 -0
- data/lib/api_reference/apis/price_api.rb +538 -0
- data/lib/api_reference/apis/price_interval_api.rb +134 -0
- data/lib/api_reference/apis/subscription_api.rb +1575 -0
- data/lib/api_reference/apis/subscription_change_api.rb +213 -0
- data/lib/api_reference/client.rb +175 -0
- data/lib/api_reference/configuration.rb +166 -0
- data/lib/api_reference/exceptions/api_exception.rb +21 -0
- data/lib/api_reference/exceptions/authorization_error_exception.rb +60 -0
- data/lib/api_reference/exceptions/idempotency_request_mismatch_exception.rb +60 -0
- data/lib/api_reference/exceptions/server_error_exception.rb +61 -0
- data/lib/api_reference/exceptions/too_many_requests_exception.rb +60 -0
- data/lib/api_reference/http/api_response.rb +19 -0
- data/lib/api_reference/http/auth/oauth_2.rb +53 -0
- data/lib/api_reference/http/http_call_back.rb +10 -0
- data/lib/api_reference/http/http_method_enum.rb +10 -0
- data/lib/api_reference/http/http_request.rb +10 -0
- data/lib/api_reference/http/http_response.rb +10 -0
- data/lib/api_reference/http/proxy_settings.rb +22 -0
- data/lib/api_reference/logging/configuration/api_logging_configuration.rb +186 -0
- data/lib/api_reference/logging/sdk_logger.rb +17 -0
- data/lib/api_reference/models/accounting_provider.rb +108 -0
- data/lib/api_reference/models/accounting_provider_config.rb +84 -0
- data/lib/api_reference/models/accounting_sync_configuration.rb +117 -0
- data/lib/api_reference/models/action.rb +68 -0
- data/lib/api_reference/models/add_adjustment_interval_params.rb +148 -0
- data/lib/api_reference/models/add_amendment_credit_ledger_entry_request_params.rb +144 -0
- data/lib/api_reference/models/add_credit_top_up_request_params.rb +149 -0
- data/lib/api_reference/models/add_decrement_credit_ledger_entry_request_params.rb +145 -0
- data/lib/api_reference/models/add_edit_price_interval_params.rb +161 -0
- data/lib/api_reference/models/add_expiration_change_credit_ledger_entry_request_params.rb +193 -0
- data/lib/api_reference/models/add_increment_credit_ledger_entry_request_params.rb +237 -0
- data/lib/api_reference/models/add_plan_adjustment_params.rb +90 -0
- data/lib/api_reference/models/add_plan_price_params.rb +103 -0
- data/lib/api_reference/models/add_price_interval_params.rb +297 -0
- data/lib/api_reference/models/add_subscription_adjustment_params.rb +146 -0
- data/lib/api_reference/models/add_subscription_price_params.rb +234 -0
- data/lib/api_reference/models/add_void_credit_ledger_entry_request_params.rb +169 -0
- data/lib/api_reference/models/address.rb +162 -0
- data/lib/api_reference/models/address_input.rb +131 -0
- data/lib/api_reference/models/adjustment_interval.rb +163 -0
- data/lib/api_reference/models/affected_block.rb +155 -0
- data/lib/api_reference/models/aggregated_cost.rb +131 -0
- data/lib/api_reference/models/alert.rb +339 -0
- data/lib/api_reference/models/alerts.rb +92 -0
- data/lib/api_reference/models/allocation.rb +157 -0
- data/lib/api_reference/models/amend_event_result.rb +73 -0
- data/lib/api_reference/models/amended_event.rb +115 -0
- data/lib/api_reference/models/amendment_ledger_entry.rb +301 -0
- data/lib/api_reference/models/amount_discount.rb +150 -0
- data/lib/api_reference/models/amount_discount_creation_params.rb +81 -0
- data/lib/api_reference/models/amount_discount_interval.rb +187 -0
- data/lib/api_reference/models/api_pagination_params.rb +74 -0
- data/lib/api_reference/models/apply_params.rb +136 -0
- data/lib/api_reference/models/auto_collection.rb +157 -0
- data/lib/api_reference/models/backfill.rb +214 -0
- data/lib/api_reference/models/backfill_status.rb +44 -0
- data/lib/api_reference/models/backfills.rb +92 -0
- data/lib/api_reference/models/balance_alert_status.rb +105 -0
- data/lib/api_reference/models/base_model.rb +110 -0
- data/lib/api_reference/models/billable_metric.rb +155 -0
- data/lib/api_reference/models/billable_metric_minified.rb +86 -0
- data/lib/api_reference/models/billable_metric_simple.rb +104 -0
- data/lib/api_reference/models/billable_metric_tiny.rb +86 -0
- data/lib/api_reference/models/billable_metrics.rb +92 -0
- data/lib/api_reference/models/billing_cycle_alignment.rb +40 -0
- data/lib/api_reference/models/billing_cycle_anchor_configuration.rb +117 -0
- data/lib/api_reference/models/billing_cycle_configuration.rb +104 -0
- data/lib/api_reference/models/billing_mode.rb +36 -0
- data/lib/api_reference/models/block_price_filter.rb +114 -0
- data/lib/api_reference/models/bulk_config.rb +87 -0
- data/lib/api_reference/models/bulk_price.rb +584 -0
- data/lib/api_reference/models/bulk_tier.rb +87 -0
- data/lib/api_reference/models/bulk_tier_with_proration.rb +88 -0
- data/lib/api_reference/models/bulk_with_filters_config.rb +98 -0
- data/lib/api_reference/models/bulk_with_filters_config1.rb +116 -0
- data/lib/api_reference/models/bulk_with_filters_price.rb +587 -0
- data/lib/api_reference/models/bulk_with_filters_tier.rb +88 -0
- data/lib/api_reference/models/bulk_with_proration_config.rb +69 -0
- data/lib/api_reference/models/bulk_with_proration_config1.rb +87 -0
- data/lib/api_reference/models/bulk_with_proration_price.rb +587 -0
- data/lib/api_reference/models/cadence.rb +52 -0
- data/lib/api_reference/models/cadence104.rb +52 -0
- data/lib/api_reference/models/cadence34.rb +48 -0
- data/lib/api_reference/models/cancel_option.rb +40 -0
- data/lib/api_reference/models/cancel_subscription_params.rb +102 -0
- data/lib/api_reference/models/change_option.rb +42 -0
- data/lib/api_reference/models/change_option1.rb +40 -0
- data/lib/api_reference/models/changed_subscription_resources.rb +185 -0
- data/lib/api_reference/models/constraint_violation_error.rb +101 -0
- data/lib/api_reference/models/conversion_rate_tier.rb +82 -0
- data/lib/api_reference/models/conversion_rate_tiered_config.rb +69 -0
- data/lib/api_reference/models/conversion_rate_unit_config.rb +60 -0
- data/lib/api_reference/models/costs_request_params.rb +118 -0
- data/lib/api_reference/models/country.rb +492 -0
- data/lib/api_reference/models/coupon.rb +195 -0
- data/lib/api_reference/models/coupon_query_params.rb +99 -0
- data/lib/api_reference/models/coupon_redemption.rb +132 -0
- data/lib/api_reference/models/coupons.rb +92 -0
- data/lib/api_reference/models/create_credit_note_params.rb +120 -0
- data/lib/api_reference/models/create_customer_alert_request_params.rb +91 -0
- data/lib/api_reference/models/create_invoice_line_item_params.rb +128 -0
- data/lib/api_reference/models/create_one_off_invoice_params.rb +255 -0
- data/lib/api_reference/models/create_subscription_alert_request_params.rb +163 -0
- data/lib/api_reference/models/created_invoice.rb +851 -0
- data/lib/api_reference/models/credit_block.rb +231 -0
- data/lib/api_reference/models/credit_block_allocation.rb +140 -0
- data/lib/api_reference/models/credit_block_expiry_ledger_entry.rb +301 -0
- data/lib/api_reference/models/credit_block_invoices_response.rb +91 -0
- data/lib/api_reference/models/credit_block_source.rb +43 -0
- data/lib/api_reference/models/credit_ledger_entries.rb +109 -0
- data/lib/api_reference/models/credit_note.rb +338 -0
- data/lib/api_reference/models/credit_note_discount.rb +152 -0
- data/lib/api_reference/models/credit_note_discount_applies_to_price.rb +104 -0
- data/lib/api_reference/models/credit_note_line_item.rb +244 -0
- data/lib/api_reference/models/credit_note_line_item_discount.rb +173 -0
- data/lib/api_reference/models/credit_note_line_item_params.rb +116 -0
- data/lib/api_reference/models/credit_note_summary.rb +181 -0
- data/lib/api_reference/models/credit_note_tiny.rb +86 -0
- data/lib/api_reference/models/credit_notes.rb +92 -0
- data/lib/api_reference/models/cumulative_grouped_allocation_config.rb +94 -0
- data/lib/api_reference/models/cumulative_grouped_allocation_config1.rb +120 -0
- data/lib/api_reference/models/cumulative_grouped_allocation_price.rb +588 -0
- data/lib/api_reference/models/cumulative_grouped_bulk_config.rb +77 -0
- data/lib/api_reference/models/cumulative_grouped_bulk_config1.rb +103 -0
- data/lib/api_reference/models/cumulative_grouped_bulk_dimension_value.rb +105 -0
- data/lib/api_reference/models/cumulative_grouped_bulk_price.rb +588 -0
- data/lib/api_reference/models/custom_expiration.rb +104 -0
- data/lib/api_reference/models/customer.rb +511 -0
- data/lib/api_reference/models/customer_balance_transaction.rb +226 -0
- data/lib/api_reference/models/customer_balance_transactions.rb +92 -0
- data/lib/api_reference/models/customer_costs.rb +81 -0
- data/lib/api_reference/models/customer_credit_balance.rb +231 -0
- data/lib/api_reference/models/customer_credit_balances.rb +92 -0
- data/lib/api_reference/models/customer_hierarchy.rb +93 -0
- data/lib/api_reference/models/customer_hierarchy2.rb +121 -0
- data/lib/api_reference/models/customer_hierarchy_config.rb +92 -0
- data/lib/api_reference/models/customer_minified.rb +107 -0
- data/lib/api_reference/models/customer_tax_id.rb +224 -0
- data/lib/api_reference/models/customers.rb +92 -0
- data/lib/api_reference/models/daily_credit_allowance_config.rb +119 -0
- data/lib/api_reference/models/daily_credit_allowance_config1.rb +150 -0
- data/lib/api_reference/models/daily_credit_allowance_matrix_value.rb +93 -0
- data/lib/api_reference/models/daily_credit_allowance_price.rb +588 -0
- data/lib/api_reference/models/date_type.rb +36 -0
- data/lib/api_reference/models/deactivate_license.rb +65 -0
- data/lib/api_reference/models/debug.rb +82 -0
- data/lib/api_reference/models/decrement_ledger_entry.rb +342 -0
- data/lib/api_reference/models/deprecated_event_result.rb +74 -0
- data/lib/api_reference/models/dimensional_price_configuration.rb +108 -0
- data/lib/api_reference/models/dimensional_price_group.rb +134 -0
- data/lib/api_reference/models/dimensional_price_groups.rb +92 -0
- data/lib/api_reference/models/discount_override.rb +116 -0
- data/lib/api_reference/models/discount_type.rb +40 -0
- data/lib/api_reference/models/discount_type1.rb +36 -0
- data/lib/api_reference/models/duplicate_resource_creation_error.rb +101 -0
- data/lib/api_reference/models/duration_unit.rb +36 -0
- data/lib/api_reference/models/duration_unit1.rb +36 -0
- data/lib/api_reference/models/duration_unit3.rb +48 -0
- data/lib/api_reference/models/edit_adjustment_interval_params.rb +130 -0
- data/lib/api_reference/models/edit_customer.rb +351 -0
- data/lib/api_reference/models/edit_dimensional_price_group.rb +86 -0
- data/lib/api_reference/models/edit_plan.rb +91 -0
- data/lib/api_reference/models/edit_price_interval_params.rb +237 -0
- data/lib/api_reference/models/effective_time.rb +26 -0
- data/lib/api_reference/models/end_of_term.rb +26 -0
- data/lib/api_reference/models/entry_status.rb +36 -0
- data/lib/api_reference/models/entry_type.rb +56 -0
- data/lib/api_reference/models/evaluate_multiple_price_resource.rb +81 -0
- data/lib/api_reference/models/evaluate_multiple_prices_body.rb +129 -0
- data/lib/api_reference/models/evaluate_multiple_prices_with_preview_events_body.rb +148 -0
- data/lib/api_reference/models/evaluate_price_body.rb +153 -0
- data/lib/api_reference/models/evaluate_price_group.rb +120 -0
- data/lib/api_reference/models/evaluate_price_resource.rb +81 -0
- data/lib/api_reference/models/evaluate_price_resource_for_multiple_price.rb +130 -0
- data/lib/api_reference/models/event.rb +149 -0
- data/lib/api_reference/models/event_output_config.rb +90 -0
- data/lib/api_reference/models/event_output_config1.rb +104 -0
- data/lib/api_reference/models/event_output_price.rb +585 -0
- data/lib/api_reference/models/event_search_criteria.rb +106 -0
- data/lib/api_reference/models/event_volume.rb +107 -0
- data/lib/api_reference/models/event_volume_params.rb +115 -0
- data/lib/api_reference/models/event_volumes.rb +81 -0
- data/lib/api_reference/models/events.rb +81 -0
- data/lib/api_reference/models/expiration_change_ledger_entry.rb +324 -0
- data/lib/api_reference/models/expires_after_unit.rb +36 -0
- data/lib/api_reference/models/external_connection_name.rb +44 -0
- data/lib/api_reference/models/external_connection_name1.rb +48 -0
- data/lib/api_reference/models/external_marketplace.rb +40 -0
- data/lib/api_reference/models/feature_not_available_error.rb +101 -0
- data/lib/api_reference/models/fetch_customer_credit_blocks_query_params.rb +181 -0
- data/lib/api_reference/models/fetch_customer_credit_ledger_query_params.rb +198 -0
- data/lib/api_reference/models/fetch_license_by_external_id.rb +72 -0
- data/lib/api_reference/models/fetch_subscription_schedule_query_params.rb +157 -0
- data/lib/api_reference/models/fetch_upcoming_invoice_params.rb +61 -0
- data/lib/api_reference/models/field.rb +48 -0
- data/lib/api_reference/models/filter_rule.rb +92 -0
- data/lib/api_reference/models/fixed_fee_quantity_change.rb +116 -0
- data/lib/api_reference/models/fixed_fee_quantity_schedule_entry.rb +145 -0
- data/lib/api_reference/models/fixed_fee_quantity_transition.rb +124 -0
- data/lib/api_reference/models/granularity.rb +26 -0
- data/lib/api_reference/models/grouped_allocation_config.rb +79 -0
- data/lib/api_reference/models/grouped_allocation_config1.rb +105 -0
- data/lib/api_reference/models/grouped_allocation_price.rb +587 -0
- data/lib/api_reference/models/grouped_subscription_usage.rb +114 -0
- data/lib/api_reference/models/grouped_subscription_usage_record.rb +149 -0
- data/lib/api_reference/models/grouped_tiered_config.rb +78 -0
- data/lib/api_reference/models/grouped_tiered_config1.rb +104 -0
- data/lib/api_reference/models/grouped_tiered_package_price.rb +588 -0
- data/lib/api_reference/models/grouped_tiered_package_pricing_config.rb +89 -0
- data/lib/api_reference/models/grouped_tiered_package_pricing_config1.rb +119 -0
- data/lib/api_reference/models/grouped_tiered_package_tier_item.rb +92 -0
- data/lib/api_reference/models/grouped_tiered_price.rb +586 -0
- data/lib/api_reference/models/grouped_tiered_tier.rb +92 -0
- data/lib/api_reference/models/grouped_with_metered_minimum_config.rb +127 -0
- data/lib/api_reference/models/grouped_with_metered_minimum_config1.rb +173 -0
- data/lib/api_reference/models/grouped_with_metered_minimum_price.rb +588 -0
- data/lib/api_reference/models/grouped_with_metered_minimum_scaling_factor_item.rb +92 -0
- data/lib/api_reference/models/grouped_with_metered_minimum_unit_amount_item.rb +91 -0
- data/lib/api_reference/models/grouped_with_min_max_thresholds_config.rb +90 -0
- data/lib/api_reference/models/grouped_with_min_max_thresholds_config1.rb +120 -0
- data/lib/api_reference/models/grouped_with_min_max_thresholds_price.rb +588 -0
- data/lib/api_reference/models/grouped_with_prorated_minimum_config.rb +78 -0
- data/lib/api_reference/models/grouped_with_prorated_minimum_config1.rb +104 -0
- data/lib/api_reference/models/grouped_with_prorated_minimum_price.rb +588 -0
- data/lib/api_reference/models/increment_credit_ledger_entry_invoice_settings.rb +197 -0
- data/lib/api_reference/models/increment_ledger_entry.rb +322 -0
- data/lib/api_reference/models/ingest_event.rb +127 -0
- data/lib/api_reference/models/ingest_event_idempotency_key_only.rb +75 -0
- data/lib/api_reference/models/ingest_query_params.rb +75 -0
- data/lib/api_reference/models/ingest_request_body.rb +69 -0
- data/lib/api_reference/models/ingestion_response.rb +97 -0
- data/lib/api_reference/models/invoice.rb +843 -0
- data/lib/api_reference/models/invoice_line_item.rb +359 -0
- data/lib/api_reference/models/invoice_line_item_params.rb +157 -0
- data/lib/api_reference/models/invoice_minified.rb +112 -0
- data/lib/api_reference/models/invoice_source.rb +40 -0
- data/lib/api_reference/models/invoice_summary.rb +525 -0
- data/lib/api_reference/models/invoice_summarys.rb +92 -0
- data/lib/api_reference/models/invoice_tiny.rb +86 -0
- data/lib/api_reference/models/invoices.rb +92 -0
- data/lib/api_reference/models/issue_invoice_request_params.rb +66 -0
- data/lib/api_reference/models/item.rb +154 -0
- data/lib/api_reference/models/item_external_connection.rb +110 -0
- data/lib/api_reference/models/item_slim.rb +105 -0
- data/lib/api_reference/models/items.rb +92 -0
- data/lib/api_reference/models/license_api_resource.rb +147 -0
- data/lib/api_reference/models/license_api_resources.rb +92 -0
- data/lib/api_reference/models/license_type.rb +119 -0
- data/lib/api_reference/models/license_type_minified.rb +86 -0
- data/lib/api_reference/models/license_types.rb +92 -0
- data/lib/api_reference/models/license_usage.rb +203 -0
- data/lib/api_reference/models/license_usage_by_external_id_query_params.rb +133 -0
- data/lib/api_reference/models/license_usage_by_type_query_params.rb +132 -0
- data/lib/api_reference/models/license_usage_query_params.rb +110 -0
- data/lib/api_reference/models/license_usages.rb +92 -0
- data/lib/api_reference/models/list_alerts_query_params.rb +189 -0
- data/lib/api_reference/models/list_credit_notes_params.rb +157 -0
- data/lib/api_reference/models/list_customer_balance_transactions_query_params.rb +158 -0
- data/lib/api_reference/models/list_customers_query_params.rb +157 -0
- data/lib/api_reference/models/list_invoices_params.rb +345 -0
- data/lib/api_reference/models/list_licenses_params.rb +125 -0
- data/lib/api_reference/models/list_metrics_query_params.rb +157 -0
- data/lib/api_reference/models/list_plans_query_params.rb +163 -0
- data/lib/api_reference/models/list_subscription_changes_query_params.rb +112 -0
- data/lib/api_reference/models/list_subscriptions_query_params.rb +258 -0
- data/lib/api_reference/models/map_item_request_params.rb +103 -0
- data/lib/api_reference/models/mark_as_paid_request_params.rb +85 -0
- data/lib/api_reference/models/matrix_cell.rb +108 -0
- data/lib/api_reference/models/matrix_config.rb +119 -0
- data/lib/api_reference/models/matrix_price.rb +584 -0
- data/lib/api_reference/models/matrix_sub_line_item.rb +173 -0
- data/lib/api_reference/models/matrix_value.rb +92 -0
- data/lib/api_reference/models/matrix_with_allocation_config.rb +99 -0
- data/lib/api_reference/models/matrix_with_allocation_config1.rb +133 -0
- data/lib/api_reference/models/matrix_with_allocation_price.rb +588 -0
- data/lib/api_reference/models/matrix_with_allocation_value_item.rb +94 -0
- data/lib/api_reference/models/matrix_with_display_name_config.rb +77 -0
- data/lib/api_reference/models/matrix_with_display_name_config1.rb +103 -0
- data/lib/api_reference/models/matrix_with_display_name_price.rb +588 -0
- data/lib/api_reference/models/matrix_with_display_name_unit_amount_item.rb +105 -0
- data/lib/api_reference/models/matrix_with_threshold_discounts_config.rb +130 -0
- data/lib/api_reference/models/matrix_with_threshold_discounts_config1.rb +157 -0
- data/lib/api_reference/models/matrix_with_threshold_discounts_price.rb +588 -0
- data/lib/api_reference/models/max_group_tiered_package_config.rb +90 -0
- data/lib/api_reference/models/max_group_tiered_package_config1.rb +120 -0
- data/lib/api_reference/models/max_group_tiered_package_price.rb +588 -0
- data/lib/api_reference/models/max_group_tiered_tier_item.rb +92 -0
- data/lib/api_reference/models/maximum.rb +135 -0
- data/lib/api_reference/models/maximum_interval.rb +177 -0
- data/lib/api_reference/models/metered_allowance_config.rb +130 -0
- data/lib/api_reference/models/metered_allowance_config1.rb +152 -0
- data/lib/api_reference/models/metered_allowance_price.rb +587 -0
- data/lib/api_reference/models/metric_group.rb +105 -0
- data/lib/api_reference/models/minimum.rb +135 -0
- data/lib/api_reference/models/minimum_composite_config.rb +73 -0
- data/lib/api_reference/models/minimum_composite_config1.rb +87 -0
- data/lib/api_reference/models/minimum_composite_price.rb +587 -0
- data/lib/api_reference/models/minimum_interval.rb +177 -0
- data/lib/api_reference/models/monetary_amount_discount_adjustment.rb +219 -0
- data/lib/api_reference/models/monetary_maximum_adjustment.rb +218 -0
- data/lib/api_reference/models/monetary_minimum_adjustment.rb +231 -0
- data/lib/api_reference/models/monetary_percentage_discount_adjustment.rb +219 -0
- data/lib/api_reference/models/monetary_tiered_percentage_discount_adjustment.rb +230 -0
- data/lib/api_reference/models/monetary_usage_discount_adjustment.rb +218 -0
- data/lib/api_reference/models/mutated_subscription.rb +683 -0
- data/lib/api_reference/models/new_accounting_sync_configuration.rb +98 -0
- data/lib/api_reference/models/new_allocation_price.rb +221 -0
- data/lib/api_reference/models/new_amount_discount.rb +202 -0
- data/lib/api_reference/models/new_anrok_configuration.rb +100 -0
- data/lib/api_reference/models/new_avalara_tax_configuration.rb +114 -0
- data/lib/api_reference/models/new_backfill.rb +165 -0
- data/lib/api_reference/models/new_billable_metric.rb +101 -0
- data/lib/api_reference/models/new_billing_cycle_configuration.rb +104 -0
- data/lib/api_reference/models/new_coupon.rb +123 -0
- data/lib/api_reference/models/new_coupon_amount_discount.rb +103 -0
- data/lib/api_reference/models/new_coupon_percentage_discount.rb +103 -0
- data/lib/api_reference/models/new_customer.rb +333 -0
- data/lib/api_reference/models/new_customer_balance_transaction.rb +81 -0
- data/lib/api_reference/models/new_dimensional_price_configuration.rb +126 -0
- data/lib/api_reference/models/new_dimensional_price_group.rb +115 -0
- data/lib/api_reference/models/new_floating_bulk_price.rb +333 -0
- data/lib/api_reference/models/new_floating_bulk_with_filters_price.rb +336 -0
- data/lib/api_reference/models/new_floating_bulk_with_proration_price.rb +336 -0
- data/lib/api_reference/models/new_floating_cumulative_grouped_allocation_price.rb +337 -0
- data/lib/api_reference/models/new_floating_cumulative_grouped_bulk_price.rb +337 -0
- data/lib/api_reference/models/new_floating_daily_credit_allowance_price.rb +337 -0
- data/lib/api_reference/models/new_floating_event_output_price.rb +334 -0
- data/lib/api_reference/models/new_floating_grouped_allocation_price.rb +336 -0
- data/lib/api_reference/models/new_floating_grouped_tiered_package_price.rb +337 -0
- data/lib/api_reference/models/new_floating_grouped_tiered_price.rb +335 -0
- data/lib/api_reference/models/new_floating_grouped_with_metered_minimum_price.rb +337 -0
- data/lib/api_reference/models/new_floating_grouped_with_min_max_thresholds_price.rb +337 -0
- data/lib/api_reference/models/new_floating_grouped_with_prorated_minimum_price.rb +337 -0
- data/lib/api_reference/models/new_floating_matrix_price.rb +333 -0
- data/lib/api_reference/models/new_floating_matrix_with_allocation_price.rb +337 -0
- data/lib/api_reference/models/new_floating_matrix_with_display_name_price.rb +337 -0
- data/lib/api_reference/models/new_floating_matrix_with_threshold_discounts_price.rb +337 -0
- data/lib/api_reference/models/new_floating_max_group_tiered_package_price.rb +337 -0
- data/lib/api_reference/models/new_floating_metered_allowance_price.rb +336 -0
- data/lib/api_reference/models/new_floating_minimum_composite_price.rb +336 -0
- data/lib/api_reference/models/new_floating_package_price.rb +333 -0
- data/lib/api_reference/models/new_floating_package_with_allocation_price.rb +337 -0
- data/lib/api_reference/models/new_floating_percent_composite_price.rb +334 -0
- data/lib/api_reference/models/new_floating_scalable_matrix_with_tiered_pricing_price.rb +338 -0
- data/lib/api_reference/models/new_floating_scalable_matrix_with_unit_pricing_price.rb +338 -0
- data/lib/api_reference/models/new_floating_threshold_total_amount_price.rb +337 -0
- data/lib/api_reference/models/new_floating_tiered_package_price.rb +336 -0
- data/lib/api_reference/models/new_floating_tiered_package_with_minimum_price.rb +337 -0
- data/lib/api_reference/models/new_floating_tiered_price.rb +333 -0
- data/lib/api_reference/models/new_floating_tiered_with_minimum_price.rb +336 -0
- data/lib/api_reference/models/new_floating_tiered_with_proration_price.rb +336 -0
- data/lib/api_reference/models/new_floating_unit_price.rb +333 -0
- data/lib/api_reference/models/new_floating_unit_with_percent_price.rb +336 -0
- data/lib/api_reference/models/new_floating_unit_with_proration_price.rb +336 -0
- data/lib/api_reference/models/new_item.rb +74 -0
- data/lib/api_reference/models/new_license.rb +108 -0
- data/lib/api_reference/models/new_license_allocation.rb +97 -0
- data/lib/api_reference/models/new_license_allocation_unit_price.rb +330 -0
- data/lib/api_reference/models/new_license_type.rb +69 -0
- data/lib/api_reference/models/new_license_type_configuration.rb +78 -0
- data/lib/api_reference/models/new_maximum.rb +202 -0
- data/lib/api_reference/models/new_minimum.rb +215 -0
- data/lib/api_reference/models/new_numeral_configuration.rb +100 -0
- data/lib/api_reference/models/new_percentage_discount.rb +202 -0
- data/lib/api_reference/models/new_plan.rb +210 -0
- data/lib/api_reference/models/new_plan_bulk_price.rb +310 -0
- data/lib/api_reference/models/new_plan_bulk_with_filters_price.rb +313 -0
- data/lib/api_reference/models/new_plan_bulk_with_proration_price.rb +313 -0
- data/lib/api_reference/models/new_plan_cumulative_grouped_allocation_price.rb +314 -0
- data/lib/api_reference/models/new_plan_cumulative_grouped_bulk_price.rb +314 -0
- data/lib/api_reference/models/new_plan_daily_credit_allowance_price.rb +314 -0
- data/lib/api_reference/models/new_plan_event_output_price.rb +311 -0
- data/lib/api_reference/models/new_plan_grouped_allocation_price.rb +313 -0
- data/lib/api_reference/models/new_plan_grouped_tiered_package_price.rb +314 -0
- data/lib/api_reference/models/new_plan_grouped_tiered_price.rb +312 -0
- data/lib/api_reference/models/new_plan_grouped_with_metered_minimum_price.rb +314 -0
- data/lib/api_reference/models/new_plan_grouped_with_min_max_thresholds_price.rb +314 -0
- data/lib/api_reference/models/new_plan_grouped_with_prorated_minimum_price.rb +314 -0
- data/lib/api_reference/models/new_plan_matrix_price.rb +310 -0
- data/lib/api_reference/models/new_plan_matrix_with_allocation_price.rb +314 -0
- data/lib/api_reference/models/new_plan_matrix_with_display_name_price.rb +314 -0
- data/lib/api_reference/models/new_plan_matrix_with_threshold_discounts_price.rb +314 -0
- data/lib/api_reference/models/new_plan_max_group_tiered_package_price.rb +314 -0
- data/lib/api_reference/models/new_plan_metered_allowance_price.rb +313 -0
- data/lib/api_reference/models/new_plan_minimum_composite_price.rb +313 -0
- data/lib/api_reference/models/new_plan_package_price.rb +310 -0
- data/lib/api_reference/models/new_plan_package_with_allocation_price.rb +314 -0
- data/lib/api_reference/models/new_plan_percent_composite_price.rb +311 -0
- data/lib/api_reference/models/new_plan_phase.rb +104 -0
- data/lib/api_reference/models/new_plan_scalable_matrix_with_tiered_pricing_price.rb +315 -0
- data/lib/api_reference/models/new_plan_scalable_matrix_with_unit_pricing_price.rb +315 -0
- data/lib/api_reference/models/new_plan_threshold_total_amount_price.rb +314 -0
- data/lib/api_reference/models/new_plan_tiered_package_price.rb +313 -0
- data/lib/api_reference/models/new_plan_tiered_package_with_minimum_price.rb +314 -0
- data/lib/api_reference/models/new_plan_tiered_price.rb +310 -0
- data/lib/api_reference/models/new_plan_tiered_with_minimum_price.rb +313 -0
- data/lib/api_reference/models/new_plan_tiered_with_proration_price.rb +313 -0
- data/lib/api_reference/models/new_plan_unit_price.rb +310 -0
- data/lib/api_reference/models/new_plan_unit_with_percent_price.rb +313 -0
- data/lib/api_reference/models/new_plan_unit_with_proration_price.rb +313 -0
- data/lib/api_reference/models/new_plan_version.rb +197 -0
- data/lib/api_reference/models/new_portal_session.rb +78 -0
- data/lib/api_reference/models/new_reporting_configuration.rb +73 -0
- data/lib/api_reference/models/new_sphere_configuration.rb +100 -0
- data/lib/api_reference/models/new_stripe_tax_configuration.rb +100 -0
- data/lib/api_reference/models/new_subscription.rb +603 -0
- data/lib/api_reference/models/new_subscription_bulk_price.rb +310 -0
- data/lib/api_reference/models/new_subscription_bulk_with_filters_price.rb +313 -0
- data/lib/api_reference/models/new_subscription_bulk_with_proration_price.rb +313 -0
- data/lib/api_reference/models/new_subscription_cumulative_grouped_allocation_price.rb +314 -0
- data/lib/api_reference/models/new_subscription_cumulative_grouped_bulk_price.rb +314 -0
- data/lib/api_reference/models/new_subscription_daily_credit_allowance_price.rb +314 -0
- data/lib/api_reference/models/new_subscription_event_output_price.rb +311 -0
- data/lib/api_reference/models/new_subscription_grouped_allocation_price.rb +313 -0
- data/lib/api_reference/models/new_subscription_grouped_tiered_package_price.rb +314 -0
- data/lib/api_reference/models/new_subscription_grouped_tiered_price.rb +312 -0
- data/lib/api_reference/models/new_subscription_grouped_with_metered_minimum_price.rb +314 -0
- data/lib/api_reference/models/new_subscription_grouped_with_min_max_thresholds_price.rb +314 -0
- data/lib/api_reference/models/new_subscription_grouped_with_prorated_minimum_price.rb +314 -0
- data/lib/api_reference/models/new_subscription_matrix_price.rb +310 -0
- data/lib/api_reference/models/new_subscription_matrix_with_allocation_price.rb +314 -0
- data/lib/api_reference/models/new_subscription_matrix_with_display_name_price.rb +314 -0
- data/lib/api_reference/models/new_subscription_matrix_with_threshold_discounts_price.rb +314 -0
- data/lib/api_reference/models/new_subscription_max_group_tiered_package_price.rb +314 -0
- data/lib/api_reference/models/new_subscription_metered_allowance_price.rb +313 -0
- data/lib/api_reference/models/new_subscription_minimum_composite_price.rb +313 -0
- data/lib/api_reference/models/new_subscription_package_price.rb +310 -0
- data/lib/api_reference/models/new_subscription_package_with_allocation_price.rb +314 -0
- data/lib/api_reference/models/new_subscription_percent_composite_price.rb +311 -0
- data/lib/api_reference/models/new_subscription_scalable_matrix_with_tiered_pricing_price.rb +315 -0
- data/lib/api_reference/models/new_subscription_scalable_matrix_with_unit_pricing_price.rb +315 -0
- data/lib/api_reference/models/new_subscription_threshold_total_amount_price.rb +314 -0
- data/lib/api_reference/models/new_subscription_tiered_package_price.rb +313 -0
- data/lib/api_reference/models/new_subscription_tiered_package_with_minimum_price.rb +314 -0
- data/lib/api_reference/models/new_subscription_tiered_price.rb +310 -0
- data/lib/api_reference/models/new_subscription_tiered_with_minimum_price.rb +313 -0
- data/lib/api_reference/models/new_subscription_tiered_with_proration_price.rb +313 -0
- data/lib/api_reference/models/new_subscription_unit_price.rb +310 -0
- data/lib/api_reference/models/new_subscription_unit_with_percent_price.rb +313 -0
- data/lib/api_reference/models/new_subscription_unit_with_proration_price.rb +313 -0
- data/lib/api_reference/models/new_tax_jar_configuration.rb +100 -0
- data/lib/api_reference/models/new_tiered_percentage_discount.rb +214 -0
- data/lib/api_reference/models/new_tiered_percentage_discount_tier.rb +118 -0
- data/lib/api_reference/models/new_top_up_invoice_settings.rb +117 -0
- data/lib/api_reference/models/new_top_up_invoice_settings2.rb +117 -0
- data/lib/api_reference/models/new_usage_discount.rb +202 -0
- data/lib/api_reference/models/operator.rb +36 -0
- data/lib/api_reference/models/other_sub_line_item.rb +144 -0
- data/lib/api_reference/models/package_config.rb +93 -0
- data/lib/api_reference/models/package_price.rb +584 -0
- data/lib/api_reference/models/package_with_allocation_config.rb +79 -0
- data/lib/api_reference/models/package_with_allocation_config1.rb +105 -0
- data/lib/api_reference/models/package_with_allocation_price.rb +588 -0
- data/lib/api_reference/models/pagination_metadata.rb +106 -0
- data/lib/api_reference/models/pay_invoice_params.rb +62 -0
- data/lib/api_reference/models/payment_attempt.rb +184 -0
- data/lib/api_reference/models/payment_configuration.rb +95 -0
- data/lib/api_reference/models/payment_configuration_item.rb +126 -0
- data/lib/api_reference/models/payment_method.rb +188 -0
- data/lib/api_reference/models/payment_method_type.rb +49 -0
- data/lib/api_reference/models/payment_provider.rb +36 -0
- data/lib/api_reference/models/payment_provider1.rb +52 -0
- data/lib/api_reference/models/per_price_cost.rb +145 -0
- data/lib/api_reference/models/percent_composite_config.rb +109 -0
- data/lib/api_reference/models/percent_composite_config1.rb +112 -0
- data/lib/api_reference/models/percent_composite_price.rb +585 -0
- data/lib/api_reference/models/percentage_discount.rb +151 -0
- data/lib/api_reference/models/percentage_discount_creation_params.rb +104 -0
- data/lib/api_reference/models/percentage_discount_interval.rb +188 -0
- data/lib/api_reference/models/percentage_tier.rb +122 -0
- data/lib/api_reference/models/ping_response.rb +73 -0
- data/lib/api_reference/models/plan.rb +501 -0
- data/lib/api_reference/models/plan_minified.rb +125 -0
- data/lib/api_reference/models/plan_minified_with_version.rb +141 -0
- data/lib/api_reference/models/plan_phase.rb +244 -0
- data/lib/api_reference/models/plan_phase_amount_discount_adjustment.rb +221 -0
- data/lib/api_reference/models/plan_phase_maximum_adjustment.rb +221 -0
- data/lib/api_reference/models/plan_phase_minimum_adjustment.rb +233 -0
- data/lib/api_reference/models/plan_phase_percentage_discount_adjustment.rb +221 -0
- data/lib/api_reference/models/plan_phase_tiered_percentage_discount_adjustment.rb +233 -0
- data/lib/api_reference/models/plan_phase_usage_discount_adjustment.rb +221 -0
- data/lib/api_reference/models/plan_version.rb +172 -0
- data/lib/api_reference/models/plan_version_change.rb +143 -0
- data/lib/api_reference/models/plan_version_changes.rb +92 -0
- data/lib/api_reference/models/plan_version_phase.rb +163 -0
- data/lib/api_reference/models/plans.rb +92 -0
- data/lib/api_reference/models/portal_session.rb +124 -0
- data/lib/api_reference/models/preview_event.rb +115 -0
- data/lib/api_reference/models/price_evaluation_request.rb +157 -0
- data/lib/api_reference/models/price_filter.rb +116 -0
- data/lib/api_reference/models/price_group.rb +132 -0
- data/lib/api_reference/models/price_interval.rb +319 -0
- data/lib/api_reference/models/price_interval_fixed_fee_quantity_transition_params.rb +112 -0
- data/lib/api_reference/models/price_type.rb +48 -0
- data/lib/api_reference/models/price_type6.rb +40 -0
- data/lib/api_reference/models/prices.rb +109 -0
- data/lib/api_reference/models/product.rb +123 -0
- data/lib/api_reference/models/provider_type.rb +36 -0
- data/lib/api_reference/models/quantity_only_override_price.rb +147 -0
- data/lib/api_reference/models/reason.rb +44 -0
- data/lib/api_reference/models/reason1.rb +44 -0
- data/lib/api_reference/models/redeem_coupon_params.rb +126 -0
- data/lib/api_reference/models/remove_plan_adjustment_params.rb +74 -0
- data/lib/api_reference/models/remove_plan_price_params.rb +74 -0
- data/lib/api_reference/models/remove_subscription_adjustment_params.rb +74 -0
- data/lib/api_reference/models/remove_subscription_price_params.rb +90 -0
- data/lib/api_reference/models/replace_plan_adjustment_params.rb +108 -0
- data/lib/api_reference/models/replace_plan_price_params.rb +112 -0
- data/lib/api_reference/models/replace_subscription_adjustment_params.rb +108 -0
- data/lib/api_reference/models/replace_subscription_price_params.rb +203 -0
- data/lib/api_reference/models/reporting_configuration.rb +87 -0
- data/lib/api_reference/models/request_too_large_error.rb +101 -0
- data/lib/api_reference/models/request_validation_error.rb +112 -0
- data/lib/api_reference/models/resource_not_found_error.rb +99 -0
- data/lib/api_reference/models/resource_too_large_error.rb +101 -0
- data/lib/api_reference/models/scalable_matrix_with_tiered_pricing_config.rb +112 -0
- data/lib/api_reference/models/scalable_matrix_with_tiered_pricing_config1.rb +146 -0
- data/lib/api_reference/models/scalable_matrix_with_tiered_pricing_price.rb +589 -0
- data/lib/api_reference/models/scalable_matrix_with_tiered_scaling_factor.rb +109 -0
- data/lib/api_reference/models/scalable_matrix_with_tiered_tier_entry.rb +92 -0
- data/lib/api_reference/models/scalable_matrix_with_unit_pricing_config.rb +125 -0
- data/lib/api_reference/models/scalable_matrix_with_unit_pricing_config1.rb +155 -0
- data/lib/api_reference/models/scalable_matrix_with_unit_pricing_price.rb +589 -0
- data/lib/api_reference/models/scalable_matrix_with_unit_scaling_factor.rb +109 -0
- data/lib/api_reference/models/set_default_version.rb +60 -0
- data/lib/api_reference/models/start_of_term.rb +26 -0
- data/lib/api_reference/models/status.rb +40 -0
- data/lib/api_reference/models/status1.rb +48 -0
- data/lib/api_reference/models/status10.rb +40 -0
- data/lib/api_reference/models/status11.rb +48 -0
- data/lib/api_reference/models/status12.rb +40 -0
- data/lib/api_reference/models/status13.rb +40 -0
- data/lib/api_reference/models/status14.rb +40 -0
- data/lib/api_reference/models/status17.rb +37 -0
- data/lib/api_reference/models/status18.rb +49 -0
- data/lib/api_reference/models/status23.rb +48 -0
- data/lib/api_reference/models/status28.rb +40 -0
- data/lib/api_reference/models/status3.rb +36 -0
- data/lib/api_reference/models/status7.rb +36 -0
- data/lib/api_reference/models/sub_line_item_grouping.rb +106 -0
- data/lib/api_reference/models/sub_line_item_matrix_config.rb +89 -0
- data/lib/api_reference/models/subscription.rb +680 -0
- data/lib/api_reference/models/subscription_change_list_response.rb +152 -0
- data/lib/api_reference/models/subscription_change_list_responses.rb +92 -0
- data/lib/api_reference/models/subscription_change_minified.rb +86 -0
- data/lib/api_reference/models/subscription_change_response.rb +217 -0
- data/lib/api_reference/models/subscription_costs.rb +81 -0
- data/lib/api_reference/models/subscription_minified.rb +86 -0
- data/lib/api_reference/models/subscription_plan_change.rb +502 -0
- data/lib/api_reference/models/subscription_schedule_item.rb +122 -0
- data/lib/api_reference/models/subscription_schedule_items.rb +92 -0
- data/lib/api_reference/models/subscription_trial_info.rb +96 -0
- data/lib/api_reference/models/subscription_usage_request_params.rb +207 -0
- data/lib/api_reference/models/subscriptions.rb +92 -0
- data/lib/api_reference/models/tax_amount.rb +123 -0
- data/lib/api_reference/models/threshold.rb +90 -0
- data/lib/api_reference/models/threshold_discount_group.rb +147 -0
- data/lib/api_reference/models/threshold_override.rb +121 -0
- data/lib/api_reference/models/threshold_override_params.rb +97 -0
- data/lib/api_reference/models/threshold_total_amount_config.rb +83 -0
- data/lib/api_reference/models/threshold_total_amount_config1.rb +101 -0
- data/lib/api_reference/models/threshold_total_amount_price.rb +588 -0
- data/lib/api_reference/models/tier.rb +105 -0
- data/lib/api_reference/models/tier_sub_line_item.rb +160 -0
- data/lib/api_reference/models/tier_sub_line_item_tier_config.rb +119 -0
- data/lib/api_reference/models/tiered_config.rb +98 -0
- data/lib/api_reference/models/tiered_conversion_rate_config.rb +81 -0
- data/lib/api_reference/models/tiered_package_price.rb +587 -0
- data/lib/api_reference/models/tiered_package_pricing_config.rb +83 -0
- data/lib/api_reference/models/tiered_package_pricing_config1.rb +109 -0
- data/lib/api_reference/models/tiered_package_pricing_with_minimum_config.rb +79 -0
- data/lib/api_reference/models/tiered_package_pricing_with_minimum_config1.rb +105 -0
- data/lib/api_reference/models/tiered_package_tier_item.rb +92 -0
- data/lib/api_reference/models/tiered_package_with_minimum_price.rb +588 -0
- data/lib/api_reference/models/tiered_package_with_minimum_tier_item.rb +106 -0
- data/lib/api_reference/models/tiered_percentage_discount.rb +164 -0
- data/lib/api_reference/models/tiered_percentage_discount_interval.rb +201 -0
- data/lib/api_reference/models/tiered_price.rb +584 -0
- data/lib/api_reference/models/tiered_pricing_with_minimum_config.rb +93 -0
- data/lib/api_reference/models/tiered_pricing_with_minimum_config1.rb +111 -0
- data/lib/api_reference/models/tiered_pricing_with_minimum_tier_item.rb +106 -0
- data/lib/api_reference/models/tiered_total_threshold.rb +90 -0
- data/lib/api_reference/models/tiered_with_minimum_price.rb +587 -0
- data/lib/api_reference/models/tiered_with_proration_config.rb +70 -0
- data/lib/api_reference/models/tiered_with_proration_config1.rb +88 -0
- data/lib/api_reference/models/tiered_with_proration_price.rb +587 -0
- data/lib/api_reference/models/tiered_with_proration_tier.rb +92 -0
- data/lib/api_reference/models/too_many_results_error.rb +101 -0
- data/lib/api_reference/models/top_up.rb +149 -0
- data/lib/api_reference/models/top_up_invoice_settings.rb +117 -0
- data/lib/api_reference/models/top_up_invoice_settings2.rb +117 -0
- data/lib/api_reference/models/top_ups.rb +92 -0
- data/lib/api_reference/models/trial_config.rb +104 -0
- data/lib/api_reference/models/trial_discount.rb +161 -0
- data/lib/api_reference/models/trial_end_date.rb +26 -0
- data/lib/api_reference/models/trigger_subscription_phase_params.rb +84 -0
- data/lib/api_reference/models/type.rb +40 -0
- data/lib/api_reference/models/type1.rb +36 -0
- data/lib/api_reference/models/type2.rb +26 -0
- data/lib/api_reference/models/type3.rb +36 -0
- data/lib/api_reference/models/type4.rb +36 -0
- data/lib/api_reference/models/type5.rb +492 -0
- data/lib/api_reference/models/type6.rb +40 -0
- data/lib/api_reference/models/type7.rb +36 -0
- data/lib/api_reference/models/ungrouped_subscription_usage.rb +99 -0
- data/lib/api_reference/models/ungrouped_subscription_usage_record.rb +133 -0
- data/lib/api_reference/models/unit_config.rb +85 -0
- data/lib/api_reference/models/unit_conversion_rate_config.rb +80 -0
- data/lib/api_reference/models/unit_price.rb +584 -0
- data/lib/api_reference/models/unit_with_percent_config.rb +68 -0
- data/lib/api_reference/models/unit_with_percent_config1.rb +90 -0
- data/lib/api_reference/models/unit_with_percent_price.rb +587 -0
- data/lib/api_reference/models/unit_with_proration_config.rb +60 -0
- data/lib/api_reference/models/unit_with_proration_config1.rb +74 -0
- data/lib/api_reference/models/unit_with_proration_price.rb +587 -0
- data/lib/api_reference/models/unschedule_fixed_fee_quantity_change_params.rb +60 -0
- data/lib/api_reference/models/upcoming_invoice.rb +838 -0
- data/lib/api_reference/models/update_alert_query_params.rb +65 -0
- data/lib/api_reference/models/update_alert_request_params.rb +116 -0
- data/lib/api_reference/models/update_invoice_request_params.rb +145 -0
- data/lib/api_reference/models/update_metric_request_params.rb +66 -0
- data/lib/api_reference/models/update_price_request_params.rb +66 -0
- data/lib/api_reference/models/update_subscription_params.rb +137 -0
- data/lib/api_reference/models/update_trial_request_params.rb +94 -0
- data/lib/api_reference/models/url_not_found.rb +101 -0
- data/lib/api_reference/models/usage.rb +131 -0
- data/lib/api_reference/models/usage_discount.rb +129 -0
- data/lib/api_reference/models/usage_discount_creation_params.rb +82 -0
- data/lib/api_reference/models/usage_discount_interval.rb +188 -0
- data/lib/api_reference/models/validation_error.rb +86 -0
- data/lib/api_reference/models/view_mode.rb +36 -0
- data/lib/api_reference/models/void_initiated_ledger_entry.rb +356 -0
- data/lib/api_reference/models/void_ledger_entry.rb +334 -0
- data/lib/api_reference/models/void_reason.rb +26 -0
- data/lib/api_reference/utilities/date_time_helper.rb +11 -0
- data/lib/api_reference/utilities/file_wrapper.rb +28 -0
- data/lib/api_reference/utilities/union_type_lookup.rb +1433 -0
- data/lib/api_reference.rb +752 -0
- metadata +742 -0
|
@@ -0,0 +1,1269 @@
|
|
|
1
|
+
# api_reference
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module ApiReference
|
|
7
|
+
# CreditApi
|
|
8
|
+
class CreditApi < BaseApi
|
|
9
|
+
# This endpoint returns a credit block identified by its block_id.
|
|
10
|
+
# @param [String] block_id Required parameter: TODO: type description here
|
|
11
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
12
|
+
def fetch_credit_block(block_id)
|
|
13
|
+
@api_call
|
|
14
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
15
|
+
'/credit_blocks/{block_id}',
|
|
16
|
+
Server::DEFAULT)
|
|
17
|
+
.template_param(new_parameter(block_id, key: 'block_id')
|
|
18
|
+
.is_required(true)
|
|
19
|
+
.should_encode(true))
|
|
20
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
21
|
+
.auth(Single.new('APIKeyAuth')))
|
|
22
|
+
.response(new_response_handler
|
|
23
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
24
|
+
.deserialize_into(CreditBlock.method(:from_hash))
|
|
25
|
+
.is_api_response(true)
|
|
26
|
+
.local_error('400',
|
|
27
|
+
'Bad Request',
|
|
28
|
+
APIException)
|
|
29
|
+
.local_error('401',
|
|
30
|
+
'Unauthorized',
|
|
31
|
+
AuthorizationErrorException)
|
|
32
|
+
.local_error('404',
|
|
33
|
+
'Not Found',
|
|
34
|
+
APIException)
|
|
35
|
+
.local_error('409',
|
|
36
|
+
'Conflict',
|
|
37
|
+
IdempotencyRequestMismatchException)
|
|
38
|
+
.local_error('413',
|
|
39
|
+
'Content Too Large',
|
|
40
|
+
APIException)
|
|
41
|
+
.local_error('429',
|
|
42
|
+
'Too Many Requests',
|
|
43
|
+
TooManyRequestsException)
|
|
44
|
+
.local_error('500',
|
|
45
|
+
'Internal Server Error',
|
|
46
|
+
ServerErrorException))
|
|
47
|
+
.execute
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# This endpoint deletes a credit block by its ID.
|
|
51
|
+
# When a credit block is deleted:
|
|
52
|
+
# - The block is removed from the customer's credit ledger.
|
|
53
|
+
# - Any usage of the credit block is reversed, and the ledger is replayed as
|
|
54
|
+
# if the block never existed.
|
|
55
|
+
# - If invoices were generated from the purchase of the credit block, they
|
|
56
|
+
# will be deleted if in draft status,
|
|
57
|
+
# voided if issued, or a credit note will be issued if the invoice is
|
|
58
|
+
# paid.
|
|
59
|
+
# <Note>
|
|
60
|
+
# Issued invoices that had credits applied from this block will not be
|
|
61
|
+
# regenerated, but the ledger will
|
|
62
|
+
# reflect the state as if credits from the deleted block were never applied.
|
|
63
|
+
# </Note>
|
|
64
|
+
# @param [String] block_id Required parameter: TODO: type description here
|
|
65
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
66
|
+
def delete_credit_block(block_id)
|
|
67
|
+
@api_call
|
|
68
|
+
.request(new_request_builder(HttpMethodEnum::DELETE,
|
|
69
|
+
'/credit_blocks/{block_id}',
|
|
70
|
+
Server::DEFAULT)
|
|
71
|
+
.template_param(new_parameter(block_id, key: 'block_id')
|
|
72
|
+
.is_required(true)
|
|
73
|
+
.should_encode(true))
|
|
74
|
+
.auth(Single.new('APIKeyAuth')))
|
|
75
|
+
.response(new_response_handler
|
|
76
|
+
.is_response_void(true)
|
|
77
|
+
.is_api_response(true)
|
|
78
|
+
.local_error('400',
|
|
79
|
+
'Bad Request',
|
|
80
|
+
APIException)
|
|
81
|
+
.local_error('401',
|
|
82
|
+
'Unauthorized',
|
|
83
|
+
AuthorizationErrorException)
|
|
84
|
+
.local_error('404',
|
|
85
|
+
'Not Found',
|
|
86
|
+
APIException)
|
|
87
|
+
.local_error('409',
|
|
88
|
+
'Conflict',
|
|
89
|
+
IdempotencyRequestMismatchException)
|
|
90
|
+
.local_error('413',
|
|
91
|
+
'Content Too Large',
|
|
92
|
+
APIException)
|
|
93
|
+
.local_error('429',
|
|
94
|
+
'Too Many Requests',
|
|
95
|
+
TooManyRequestsException)
|
|
96
|
+
.local_error('500',
|
|
97
|
+
'Internal Server Error',
|
|
98
|
+
ServerErrorException))
|
|
99
|
+
.execute
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# This endpoint returns the credit block and its associated purchasing
|
|
103
|
+
# invoices.
|
|
104
|
+
# If a credit block was purchased (as opposed to being manually added),
|
|
105
|
+
# this endpoint returns the invoices that were created to charge the
|
|
106
|
+
# customer for the credit block.
|
|
107
|
+
# For credit blocks with payment schedules spanning multiple periods (e.g.,
|
|
108
|
+
# monthly payments over 12 months),
|
|
109
|
+
# multiple invoices will be returned.
|
|
110
|
+
# For credit blocks created by subscription allocation prices, this endpoint
|
|
111
|
+
# returns the subscription
|
|
112
|
+
# invoice containing the allocation line item that created the block.
|
|
113
|
+
# If the credit block was not purchased (e.g., manual increment), an empty
|
|
114
|
+
# invoices list is returned.
|
|
115
|
+
# **Note: This endpoint is currently experimental and its interface may
|
|
116
|
+
# change in future releases.
|
|
117
|
+
# Please contact support before building production integrations against
|
|
118
|
+
# this endpoint.**
|
|
119
|
+
# @param [String] block_id Required parameter: TODO: type description here
|
|
120
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
121
|
+
def list_credit_block_invoices(block_id)
|
|
122
|
+
@api_call
|
|
123
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
124
|
+
'/credit_blocks/{block_id}/invoices',
|
|
125
|
+
Server::DEFAULT)
|
|
126
|
+
.template_param(new_parameter(block_id, key: 'block_id')
|
|
127
|
+
.is_required(true)
|
|
128
|
+
.should_encode(true))
|
|
129
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
130
|
+
.auth(Single.new('APIKeyAuth')))
|
|
131
|
+
.response(new_response_handler
|
|
132
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
133
|
+
.deserialize_into(CreditBlockInvoicesResponse.method(:from_hash))
|
|
134
|
+
.is_api_response(true)
|
|
135
|
+
.local_error('400',
|
|
136
|
+
'Bad Request',
|
|
137
|
+
APIException)
|
|
138
|
+
.local_error('401',
|
|
139
|
+
'Unauthorized',
|
|
140
|
+
AuthorizationErrorException)
|
|
141
|
+
.local_error('404',
|
|
142
|
+
'Not Found',
|
|
143
|
+
APIException)
|
|
144
|
+
.local_error('409',
|
|
145
|
+
'Conflict',
|
|
146
|
+
IdempotencyRequestMismatchException)
|
|
147
|
+
.local_error('413',
|
|
148
|
+
'Content Too Large',
|
|
149
|
+
APIException)
|
|
150
|
+
.local_error('429',
|
|
151
|
+
'Too Many Requests',
|
|
152
|
+
TooManyRequestsException)
|
|
153
|
+
.local_error('500',
|
|
154
|
+
'Internal Server Error',
|
|
155
|
+
ServerErrorException))
|
|
156
|
+
.execute
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Returns a paginated list of unexpired, non-zero credit blocks for a
|
|
160
|
+
# customer.
|
|
161
|
+
# If `include_all_blocks` is set to `true`, all credit blocks (including
|
|
162
|
+
# expired and depleted blocks) will be included in
|
|
163
|
+
# the response.
|
|
164
|
+
# Note that `currency` defaults to credits if not specified. To use a real
|
|
165
|
+
# world currency, set `currency` to an ISO 4217 string.
|
|
166
|
+
# Results can be filtered by the block's `effective_date` using the
|
|
167
|
+
# `effective_date[gte]`, `effective_date[gt]`,
|
|
168
|
+
# `effective_date[lt]`, and `effective_date[lte]` query parameters. This
|
|
169
|
+
# filters on when the credit block
|
|
170
|
+
# becomes effective, which may differ from creation time for backdated
|
|
171
|
+
# credits.
|
|
172
|
+
# @param [String] external_customer_id Required parameter: TODO: type
|
|
173
|
+
# description here
|
|
174
|
+
# @param [Integer] limit Optional parameter: Example:20
|
|
175
|
+
# @param [String] cursor Optional parameter: TODO: type description here
|
|
176
|
+
# @param [String] currency Optional parameter: TODO: type description here
|
|
177
|
+
# @param [TrueClass | FalseClass] include_all_blocks Optional parameter:
|
|
178
|
+
# Example:false
|
|
179
|
+
# @param [DateTime] effective_date_gte Optional parameter: TODO: type
|
|
180
|
+
# description here
|
|
181
|
+
# @param [DateTime] effective_date_gt Optional parameter: TODO: type
|
|
182
|
+
# description here
|
|
183
|
+
# @param [DateTime] effective_date_lt Optional parameter: TODO: type
|
|
184
|
+
# description here
|
|
185
|
+
# @param [DateTime] effective_date_lte Optional parameter: TODO: type
|
|
186
|
+
# description here
|
|
187
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
188
|
+
def fetch_customer_credits_external_id(external_customer_id: nil,
|
|
189
|
+
limit: 20,
|
|
190
|
+
cursor: nil,
|
|
191
|
+
currency: nil,
|
|
192
|
+
include_all_blocks: false,
|
|
193
|
+
effective_date_gte: nil,
|
|
194
|
+
effective_date_gt: nil,
|
|
195
|
+
effective_date_lt: nil,
|
|
196
|
+
effective_date_lte: nil)
|
|
197
|
+
@api_call
|
|
198
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
199
|
+
'/customers/external_customer_id/{external_customer_id}/credits',
|
|
200
|
+
Server::DEFAULT)
|
|
201
|
+
.template_param(new_parameter(external_customer_id, key: 'external_customer_id')
|
|
202
|
+
.should_encode(true))
|
|
203
|
+
.query_param(new_parameter(limit, key: 'limit'))
|
|
204
|
+
.query_param(new_parameter(cursor, key: 'cursor'))
|
|
205
|
+
.query_param(new_parameter(currency, key: 'currency'))
|
|
206
|
+
.query_param(new_parameter(include_all_blocks, key: 'include_all_blocks'))
|
|
207
|
+
.query_param(new_parameter(effective_date_gte, key: 'effective_date[gte]'))
|
|
208
|
+
.query_param(new_parameter(effective_date_gt, key: 'effective_date[gt]'))
|
|
209
|
+
.query_param(new_parameter(effective_date_lt, key: 'effective_date[lt]'))
|
|
210
|
+
.query_param(new_parameter(effective_date_lte, key: 'effective_date[lte]'))
|
|
211
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
212
|
+
.auth(Single.new('APIKeyAuth')))
|
|
213
|
+
.response(new_response_handler
|
|
214
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
215
|
+
.deserialize_into(CustomerCreditBalances.method(:from_hash))
|
|
216
|
+
.is_api_response(true)
|
|
217
|
+
.local_error('400',
|
|
218
|
+
'Bad Request',
|
|
219
|
+
APIException)
|
|
220
|
+
.local_error('401',
|
|
221
|
+
'Unauthorized',
|
|
222
|
+
AuthorizationErrorException)
|
|
223
|
+
.local_error('404',
|
|
224
|
+
'Not Found',
|
|
225
|
+
APIException)
|
|
226
|
+
.local_error('409',
|
|
227
|
+
'Conflict',
|
|
228
|
+
IdempotencyRequestMismatchException)
|
|
229
|
+
.local_error('413',
|
|
230
|
+
'Content Too Large',
|
|
231
|
+
APIException)
|
|
232
|
+
.local_error('429',
|
|
233
|
+
'Too Many Requests',
|
|
234
|
+
TooManyRequestsException)
|
|
235
|
+
.local_error('500',
|
|
236
|
+
'Internal Server Error',
|
|
237
|
+
ServerErrorException))
|
|
238
|
+
.execute
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# The credits ledger provides _auditing_ functionality over Orb's credits
|
|
242
|
+
# system with a list of actions that have
|
|
243
|
+
# taken place to modify a customer's credit balance. This [paginated
|
|
244
|
+
# endpoint](/api-reference/pagination) lists these
|
|
245
|
+
# entries, starting from the most recent ledger entry.
|
|
246
|
+
# More details on using Orb's real-time credit feature are
|
|
247
|
+
# [here](/product-catalog/prepurchase).
|
|
248
|
+
# There are four major types of modifications to credit balance, detailed
|
|
249
|
+
# below.
|
|
250
|
+
# ## Increment
|
|
251
|
+
# Credits (which optionally expire on a future date) can be added via the
|
|
252
|
+
# API
|
|
253
|
+
# ([Add Ledger Entry](create-ledger-entry)). The ledger entry for such an
|
|
254
|
+
# action will always contain the total
|
|
255
|
+
# eligible starting and ending balance for the customer at the time the
|
|
256
|
+
# entry was added to the ledger.
|
|
257
|
+
# ## Decrement
|
|
258
|
+
# Deductions can occur as a result of an API call to create a ledger entry
|
|
259
|
+
# (see
|
|
260
|
+
# [Add Ledger Entry](create-ledger-entry)), or automatically as a result of
|
|
261
|
+
# incurring usage. Both ledger entries
|
|
262
|
+
# present the `decrement` entry type.
|
|
263
|
+
# As usage for a customer is reported into Orb, credits may be deducted
|
|
264
|
+
# according to the customer's plan
|
|
265
|
+
# configuration. An automated deduction of this type will result in a ledger
|
|
266
|
+
# entry, also with a starting and ending
|
|
267
|
+
# balance. Each day's usage for a particular price, invoice, and block will
|
|
268
|
+
# be grouped into a single entry.
|
|
269
|
+
# By default, Orb uses an algorithm that automatically deducts from the
|
|
270
|
+
# *soonest expiring credit block* first in
|
|
271
|
+
# order to ensure that all credits are utilized appropriately. As an
|
|
272
|
+
# example, if trial credits with an expiration date
|
|
273
|
+
# of 2 weeks from now are present for a customer, they will be used before
|
|
274
|
+
# any deductions take place from a
|
|
275
|
+
# non-expiring credit block.
|
|
276
|
+
# If there are multiple blocks with the same expiration date, Orb will
|
|
277
|
+
# deduct from the block with the
|
|
278
|
+
# *lower cost basis* first (e.g. trial credits with a \$0 cost basis before
|
|
279
|
+
# paid credits with a \$5.00 cost basis).
|
|
280
|
+
# It's also possible for a single usage event's deduction to _span_ credit
|
|
281
|
+
# blocks. In this case, Orb will deduct from
|
|
282
|
+
# the next block, ending at the credit block which consists of unexpiring
|
|
283
|
+
# credits. Each of these deductions will lead
|
|
284
|
+
# to a _separate_ ledger entry, one per credit block that is deducted from.
|
|
285
|
+
# By default, the customer's total credit
|
|
286
|
+
# balance in Orb can be negative as a result of a decrement.
|
|
287
|
+
# ## Expiration change
|
|
288
|
+
# The expiry of credits can be changed as a result of the API (See [Add
|
|
289
|
+
# Ledger Entry](create-ledger-entry)). This will
|
|
290
|
+
# create a ledger entry that specifies the balance as well as the initial
|
|
291
|
+
# and target expiry dates.
|
|
292
|
+
# Note that for this entry type, `starting_balance` will equal
|
|
293
|
+
# `ending_balance`, and the `amount` represents the
|
|
294
|
+
# balance transferred. The credit block linked to the ledger entry is the
|
|
295
|
+
# source credit block from which there was an
|
|
296
|
+
# expiration change.
|
|
297
|
+
# ## Credits expiry
|
|
298
|
+
# When a set of credits expire on pre-set expiration date, the customer's
|
|
299
|
+
# balance automatically reflects this change
|
|
300
|
+
# and adds an entry to the ledger indicating this event. Note that credit
|
|
301
|
+
# expiry should always happen close to a date
|
|
302
|
+
# boundary in the customer's timezone.
|
|
303
|
+
# ## Void initiated
|
|
304
|
+
# Credit blocks can be voided via the API. The `amount` on this entry
|
|
305
|
+
# corresponds to the number of credits that were
|
|
306
|
+
# remaining in the block at time of void. `void_reason` will be populated if
|
|
307
|
+
# the void is created with a reason.
|
|
308
|
+
# ## Void
|
|
309
|
+
# When a set of credits is voided, the customer's balance automatically
|
|
310
|
+
# reflects this change and adds an entry to the
|
|
311
|
+
# ledger indicating this event.
|
|
312
|
+
# ## Amendment
|
|
313
|
+
# When credits are added to a customer's balance as a result of a
|
|
314
|
+
# correction, this entry will be added to the ledger
|
|
315
|
+
# to indicate the adjustment of credits.
|
|
316
|
+
# @param [String] external_customer_id Required parameter: TODO: type
|
|
317
|
+
# description here
|
|
318
|
+
# @param [Integer] limit Optional parameter: Example:20
|
|
319
|
+
# @param [String] cursor Optional parameter: TODO: type description here
|
|
320
|
+
# @param [String] currency Optional parameter: TODO: type description here
|
|
321
|
+
# @param [String] minimum_amount Optional parameter: TODO: type description
|
|
322
|
+
# here
|
|
323
|
+
# @param [EntryType] entry_type Optional parameter: Example:
|
|
324
|
+
# @param [EntryStatus] entry_status Optional parameter: Example:
|
|
325
|
+
# @param [DateTime] created_at_gte Optional parameter: TODO: type
|
|
326
|
+
# description here
|
|
327
|
+
# @param [DateTime] created_at_gt Optional parameter: TODO: type description
|
|
328
|
+
# here
|
|
329
|
+
# @param [DateTime] created_at_lt Optional parameter: TODO: type description
|
|
330
|
+
# here
|
|
331
|
+
# @param [DateTime] created_at_lte Optional parameter: TODO: type
|
|
332
|
+
# description here
|
|
333
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
334
|
+
def fetch_customer_credits_ledger_external_id(external_customer_id: nil,
|
|
335
|
+
limit: 20,
|
|
336
|
+
cursor: nil,
|
|
337
|
+
currency: nil,
|
|
338
|
+
minimum_amount: nil,
|
|
339
|
+
entry_type: nil,
|
|
340
|
+
entry_status: nil,
|
|
341
|
+
created_at_gte: nil,
|
|
342
|
+
created_at_gt: nil,
|
|
343
|
+
created_at_lt: nil,
|
|
344
|
+
created_at_lte: nil)
|
|
345
|
+
@api_call
|
|
346
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
347
|
+
'/customers/external_customer_id/{external_customer_id}/credits/ledger',
|
|
348
|
+
Server::DEFAULT)
|
|
349
|
+
.template_param(new_parameter(external_customer_id, key: 'external_customer_id')
|
|
350
|
+
.should_encode(true))
|
|
351
|
+
.query_param(new_parameter(limit, key: 'limit'))
|
|
352
|
+
.query_param(new_parameter(cursor, key: 'cursor'))
|
|
353
|
+
.query_param(new_parameter(currency, key: 'currency'))
|
|
354
|
+
.query_param(new_parameter(minimum_amount, key: 'minimum_amount'))
|
|
355
|
+
.query_param(new_parameter(entry_type, key: 'entry_type'))
|
|
356
|
+
.query_param(new_parameter(entry_status, key: 'entry_status'))
|
|
357
|
+
.query_param(new_parameter(created_at_gte, key: 'created_at[gte]'))
|
|
358
|
+
.query_param(new_parameter(created_at_gt, key: 'created_at[gt]'))
|
|
359
|
+
.query_param(new_parameter(created_at_lt, key: 'created_at[lt]'))
|
|
360
|
+
.query_param(new_parameter(created_at_lte, key: 'created_at[lte]'))
|
|
361
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
362
|
+
.auth(Single.new('APIKeyAuth')))
|
|
363
|
+
.response(new_response_handler
|
|
364
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
365
|
+
.deserialize_into(CreditLedgerEntries.method(:from_hash))
|
|
366
|
+
.is_api_response(true)
|
|
367
|
+
.local_error('400',
|
|
368
|
+
'Bad Request',
|
|
369
|
+
APIException)
|
|
370
|
+
.local_error('401',
|
|
371
|
+
'Unauthorized',
|
|
372
|
+
AuthorizationErrorException)
|
|
373
|
+
.local_error('404',
|
|
374
|
+
'Not Found',
|
|
375
|
+
APIException)
|
|
376
|
+
.local_error('409',
|
|
377
|
+
'Conflict',
|
|
378
|
+
IdempotencyRequestMismatchException)
|
|
379
|
+
.local_error('413',
|
|
380
|
+
'Content Too Large',
|
|
381
|
+
APIException)
|
|
382
|
+
.local_error('429',
|
|
383
|
+
'Too Many Requests',
|
|
384
|
+
TooManyRequestsException)
|
|
385
|
+
.local_error('500',
|
|
386
|
+
'Internal Server Error',
|
|
387
|
+
ServerErrorException))
|
|
388
|
+
.execute
|
|
389
|
+
end
|
|
390
|
+
|
|
391
|
+
# This endpoint allows you to create a new ledger entry for a specified
|
|
392
|
+
# customer's balance. This can be used to
|
|
393
|
+
# increment balance, deduct credits, and change the expiry date of existing
|
|
394
|
+
# credits.
|
|
395
|
+
# ## Effects of adding a ledger entry
|
|
396
|
+
# 1. After calling this endpoint, [Fetch Credit
|
|
397
|
+
# Balance](fetch-customer-credits) will return a credit block that
|
|
398
|
+
# represents the changes (i.e. balance changes or transfers).
|
|
399
|
+
# 2. A ledger entry will be added to the credits ledger for this customer,
|
|
400
|
+
# and therefore returned in the
|
|
401
|
+
# [View Credits Ledger](fetch-customer-credits-ledger) response as well as
|
|
402
|
+
# serialized in the response to this request. In
|
|
403
|
+
# the case of deductions without a specified block, multiple ledger
|
|
404
|
+
# entries may be created if the deduction spans
|
|
405
|
+
# credit blocks.
|
|
406
|
+
# 3. If `invoice_settings` is specified, an invoice will be created that
|
|
407
|
+
# reflects the cost of the credits (based on
|
|
408
|
+
# `amount` and `per_unit_cost_basis`).
|
|
409
|
+
# ## Adding credits
|
|
410
|
+
# Adding credits is done by creating an entry of type `increment`. This
|
|
411
|
+
# requires the caller to specify a number of
|
|
412
|
+
# credits as well as an optional expiry date in `YYYY-MM-DD` format. Orb
|
|
413
|
+
# also recommends specifying a description
|
|
414
|
+
# to assist with auditing. When adding credits, the caller can also
|
|
415
|
+
# specify a cost basis per-credit, to indicate
|
|
416
|
+
# how much in USD a customer paid for a single credit in a block. This can
|
|
417
|
+
# later be used for revenue recognition.
|
|
418
|
+
# The following snippet illustrates a sample request body to increment
|
|
419
|
+
# credits which will expire in January of 2022.
|
|
420
|
+
# ```json
|
|
421
|
+
# {
|
|
422
|
+
# "entry_type": "increment",
|
|
423
|
+
# "amount": 100,
|
|
424
|
+
# "expiry_date": "2022-12-28",
|
|
425
|
+
# "per_unit_cost_basis": "0.20",
|
|
426
|
+
# "description": "Purchased 100 credits"
|
|
427
|
+
# }
|
|
428
|
+
# ```
|
|
429
|
+
# Note that an `increment` entry always creates a new credit block (defined
|
|
430
|
+
# by the optional `effective_date` and
|
|
431
|
+
# `expiry_date`); it never modifies an existing block.
|
|
432
|
+
# ### Invoicing for credits
|
|
433
|
+
# By default, Orb manipulates the credit ledger but does not charge for
|
|
434
|
+
# credits. However, if you pass
|
|
435
|
+
# `invoice_settings` in the body of this request, Orb will also generate a
|
|
436
|
+
# one-off invoice for the customer for the
|
|
437
|
+
# credits pre-purchase. Note that you _must_ provide the
|
|
438
|
+
# `per_unit_cost_basis`, since the total charges on the
|
|
439
|
+
# invoice are calculated by multiplying the cost basis with the number of
|
|
440
|
+
# credit units added. If you invoice or handle payment
|
|
441
|
+
# of credits outside of Orb (i.e. marketplace customers), set `mark_as_paid`
|
|
442
|
+
# in the `invoice_settings` to `true` to prevent
|
|
443
|
+
# duplicate invoicing effects.
|
|
444
|
+
# * if `per_unit_cost_basis` is greater than zero, an invoice will be
|
|
445
|
+
# generated and `invoice_settings` must be included
|
|
446
|
+
# * if `invoice_settings` is passed, one of either `custom_due_date` or
|
|
447
|
+
# `net_terms` is required to determine the due date
|
|
448
|
+
# ## Deducting Credits
|
|
449
|
+
# Orb allows you to deduct credits from a customer by creating an entry of
|
|
450
|
+
# type `decrement`. A `decrement` entry
|
|
451
|
+
# records credits as usage and immediately recognizes revenue at the block's
|
|
452
|
+
# `per_unit_cost_basis`.
|
|
453
|
+
# For most credit removals, use `void` (no revenue impact) or
|
|
454
|
+
# `expiration_change` (revenue recognized on expiration)
|
|
455
|
+
# instead. Only use `decrement` when credits were genuinely consumed outside
|
|
456
|
+
# of normal event ingestion.
|
|
457
|
+
# Orb matches the algorithm for automatic deductions for determining which
|
|
458
|
+
# credit blocks to decrement from. In the
|
|
459
|
+
# case that the deduction leads to multiple ledger entries, the response
|
|
460
|
+
# from this endpoint will be the final
|
|
461
|
+
# deduction. Orb also optionally allows specifying a description to assist
|
|
462
|
+
# with auditing.
|
|
463
|
+
# The following snippet illustrates a sample request body to decrement
|
|
464
|
+
# credits.
|
|
465
|
+
# ```json
|
|
466
|
+
# {
|
|
467
|
+
# "entry_type": "decrement",
|
|
468
|
+
# "amount": 20,
|
|
469
|
+
# "description": "Removing excess credits"
|
|
470
|
+
# }
|
|
471
|
+
# ```
|
|
472
|
+
# ## Changing credits expiry
|
|
473
|
+
# If you'd like to change when existing credits expire, you should create a
|
|
474
|
+
# ledger entry of type `expiration_change`.
|
|
475
|
+
# For this entry, the required parameter `expiry_date` identifies the
|
|
476
|
+
# _originating_ block, and the required parameter
|
|
477
|
+
# `target_expiry_date` identifies when the transferred credits should now
|
|
478
|
+
# expire. A new credit block will be created
|
|
479
|
+
# with expiry date `target_expiry_date`, with the same cost basis data as
|
|
480
|
+
# the original credit block, if present.
|
|
481
|
+
# Note that the balance of the block with the given `expiry_date` must be at
|
|
482
|
+
# least equal to the desired transfer
|
|
483
|
+
# amount determined by the `amount` parameter.
|
|
484
|
+
# The following snippet illustrates a sample request body to extend the
|
|
485
|
+
# expiration date of credits by one year:
|
|
486
|
+
# ```json
|
|
487
|
+
# {
|
|
488
|
+
# "entry_type": "expiration_change",
|
|
489
|
+
# "amount": 10,
|
|
490
|
+
# "expiry_date": "2022-12-28",
|
|
491
|
+
# "block_id": "UiUhFWeLHPrBY4Ad",
|
|
492
|
+
# "target_expiry_date": "2023-12-28",
|
|
493
|
+
# "description": "Extending credit validity"
|
|
494
|
+
# }
|
|
495
|
+
# ```
|
|
496
|
+
# ## Voiding credits
|
|
497
|
+
# If you'd like to void a credit block, create a ledger entry of type
|
|
498
|
+
# `void`. For this entry, `block_id` is required
|
|
499
|
+
# to identify the block, and `amount` indicates how many credits to void, up
|
|
500
|
+
# to the block's initial balance. Pass
|
|
501
|
+
# in a `void_reason` of `refund` if the void is due to a refund.
|
|
502
|
+
# ## Amendment
|
|
503
|
+
# If you'd like to undo a decrement on a credit block, create a ledger entry
|
|
504
|
+
# of type `amendment`. For this entry, `block_id`
|
|
505
|
+
# is required to identify the block that was originally decremented from,
|
|
506
|
+
# and `amount` indicates how many credits to return
|
|
507
|
+
# to the customer, up to the block's initial balance.
|
|
508
|
+
# @param [String] external_customer_id Required parameter: TODO: type
|
|
509
|
+
# description here
|
|
510
|
+
# @param [AddIncrementCreditLedgerEntryRequestParams |
|
|
511
|
+
# AddDecrementCreditLedgerEntryRequestParams |
|
|
512
|
+
# AddExpirationChangeCreditLedgerEntryRequestParams |
|
|
513
|
+
# AddVoidCreditLedgerEntryRequestParams |
|
|
514
|
+
# AddAmendmentCreditLedgerEntryRequestParams] body Required parameter: TODO:
|
|
515
|
+
# type description here
|
|
516
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
517
|
+
def create_ledger_entry_external_id(external_customer_id: nil,
|
|
518
|
+
body)
|
|
519
|
+
@api_call
|
|
520
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
521
|
+
'/customers/external_customer_id/{external_customer_id}/credits/ledger_entry',
|
|
522
|
+
Server::DEFAULT)
|
|
523
|
+
.template_param(new_parameter(external_customer_id, key: 'external_customer_id')
|
|
524
|
+
.should_encode(true))
|
|
525
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
526
|
+
.body_param(new_parameter(body)
|
|
527
|
+
.is_required(true)
|
|
528
|
+
.validator(proc do |value|
|
|
529
|
+
UnionTypeLookUp.get(:AddCreditLedgerEntryRequestParams)
|
|
530
|
+
.validate(value)
|
|
531
|
+
end))
|
|
532
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
533
|
+
.body_serializer(APIHelper.method(:json_serialize))
|
|
534
|
+
.auth(Single.new('APIKeyAuth')))
|
|
535
|
+
.response(new_response_handler
|
|
536
|
+
.deserializer(proc do |response, should_symbolize|
|
|
537
|
+
APIHelper.deserialize_union_type(
|
|
538
|
+
UnionTypeLookUp.get(:CreditLedgerEntry),
|
|
539
|
+
response, should_symbolize, true
|
|
540
|
+
)
|
|
541
|
+
end)
|
|
542
|
+
.is_api_response(true)
|
|
543
|
+
.local_error('400',
|
|
544
|
+
'Bad Request',
|
|
545
|
+
APIException)
|
|
546
|
+
.local_error('401',
|
|
547
|
+
'Unauthorized',
|
|
548
|
+
AuthorizationErrorException)
|
|
549
|
+
.local_error('404',
|
|
550
|
+
'Not Found',
|
|
551
|
+
APIException)
|
|
552
|
+
.local_error('409',
|
|
553
|
+
'Conflict',
|
|
554
|
+
IdempotencyRequestMismatchException)
|
|
555
|
+
.local_error('413',
|
|
556
|
+
'Content Too Large',
|
|
557
|
+
APIException)
|
|
558
|
+
.local_error('429',
|
|
559
|
+
'Too Many Requests',
|
|
560
|
+
TooManyRequestsException)
|
|
561
|
+
.local_error('500',
|
|
562
|
+
'Internal Server Error',
|
|
563
|
+
ServerErrorException))
|
|
564
|
+
.execute
|
|
565
|
+
end
|
|
566
|
+
|
|
567
|
+
# TODO: type endpoint description here
|
|
568
|
+
# @param [String] external_customer_id Required parameter: TODO: type
|
|
569
|
+
# description here
|
|
570
|
+
# @param [Integer] limit Optional parameter: Example:20
|
|
571
|
+
# @param [String] cursor Optional parameter: TODO: type description here
|
|
572
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
573
|
+
def list_top_ups_external_id(external_customer_id: nil,
|
|
574
|
+
limit: 20,
|
|
575
|
+
cursor: nil)
|
|
576
|
+
@api_call
|
|
577
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
578
|
+
'/customers/external_customer_id/{external_customer_id}/credits/top_ups',
|
|
579
|
+
Server::DEFAULT)
|
|
580
|
+
.template_param(new_parameter(external_customer_id, key: 'external_customer_id')
|
|
581
|
+
.should_encode(true))
|
|
582
|
+
.query_param(new_parameter(limit, key: 'limit'))
|
|
583
|
+
.query_param(new_parameter(cursor, key: 'cursor'))
|
|
584
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
585
|
+
.auth(Single.new('APIKeyAuth')))
|
|
586
|
+
.response(new_response_handler
|
|
587
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
588
|
+
.deserialize_into(TopUps.method(:from_hash))
|
|
589
|
+
.is_api_response(true)
|
|
590
|
+
.local_error('400',
|
|
591
|
+
'Bad Request',
|
|
592
|
+
APIException)
|
|
593
|
+
.local_error('401',
|
|
594
|
+
'Unauthorized',
|
|
595
|
+
AuthorizationErrorException)
|
|
596
|
+
.local_error('404',
|
|
597
|
+
'Not Found',
|
|
598
|
+
APIException)
|
|
599
|
+
.local_error('409',
|
|
600
|
+
'Conflict',
|
|
601
|
+
IdempotencyRequestMismatchException)
|
|
602
|
+
.local_error('413',
|
|
603
|
+
'Content Too Large',
|
|
604
|
+
APIException)
|
|
605
|
+
.local_error('429',
|
|
606
|
+
'Too Many Requests',
|
|
607
|
+
TooManyRequestsException)
|
|
608
|
+
.local_error('500',
|
|
609
|
+
'Internal Server Error',
|
|
610
|
+
ServerErrorException))
|
|
611
|
+
.execute
|
|
612
|
+
end
|
|
613
|
+
|
|
614
|
+
# This endpoint allows you to create a new top-up for a specified customer's
|
|
615
|
+
# balance.
|
|
616
|
+
# While this top-up is active, the customer's balance will added in
|
|
617
|
+
# increments of
|
|
618
|
+
# the specified amount whenever the balance reaches the specified threshold.
|
|
619
|
+
# If a top-up already exists for this customer in the same currency,
|
|
620
|
+
# the existing top-up will be replaced.
|
|
621
|
+
# @param [String] external_customer_id Required parameter: TODO: type
|
|
622
|
+
# description here
|
|
623
|
+
# @param [AddCreditTopUpRequestParams] body Required parameter: TODO: type
|
|
624
|
+
# description here
|
|
625
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
626
|
+
def create_top_up_external_id(external_customer_id: nil,
|
|
627
|
+
body)
|
|
628
|
+
@api_call
|
|
629
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
630
|
+
'/customers/external_customer_id/{external_customer_id}/credits/top_ups',
|
|
631
|
+
Server::DEFAULT)
|
|
632
|
+
.template_param(new_parameter(external_customer_id, key: 'external_customer_id')
|
|
633
|
+
.should_encode(true))
|
|
634
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
635
|
+
.body_param(new_parameter(body)
|
|
636
|
+
.is_required(true))
|
|
637
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
638
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
639
|
+
.auth(Single.new('APIKeyAuth')))
|
|
640
|
+
.response(new_response_handler
|
|
641
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
642
|
+
.deserialize_into(TopUp.method(:from_hash))
|
|
643
|
+
.is_api_response(true)
|
|
644
|
+
.local_error('400',
|
|
645
|
+
'Bad Request',
|
|
646
|
+
APIException)
|
|
647
|
+
.local_error('401',
|
|
648
|
+
'Unauthorized',
|
|
649
|
+
AuthorizationErrorException)
|
|
650
|
+
.local_error('404',
|
|
651
|
+
'Not Found',
|
|
652
|
+
APIException)
|
|
653
|
+
.local_error('409',
|
|
654
|
+
'Conflict',
|
|
655
|
+
IdempotencyRequestMismatchException)
|
|
656
|
+
.local_error('413',
|
|
657
|
+
'Content Too Large',
|
|
658
|
+
APIException)
|
|
659
|
+
.local_error('429',
|
|
660
|
+
'Too Many Requests',
|
|
661
|
+
TooManyRequestsException)
|
|
662
|
+
.local_error('500',
|
|
663
|
+
'Internal Server Error',
|
|
664
|
+
ServerErrorException))
|
|
665
|
+
.execute
|
|
666
|
+
end
|
|
667
|
+
|
|
668
|
+
# This deactivates the top-up and voids any invoices associated with pending
|
|
669
|
+
# credit blocks purchased through the top-up.
|
|
670
|
+
# @param [String] top_up_id Required parameter: TODO: type description
|
|
671
|
+
# here
|
|
672
|
+
# @param [String] external_customer_id Required parameter: TODO: type
|
|
673
|
+
# description here
|
|
674
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
675
|
+
def delete_top_up_external_id(top_up_id,
|
|
676
|
+
external_customer_id: nil)
|
|
677
|
+
@api_call
|
|
678
|
+
.request(new_request_builder(HttpMethodEnum::DELETE,
|
|
679
|
+
'/customers/external_customer_id/{external_customer_id}/credits/top_ups/{top_up_id}',
|
|
680
|
+
Server::DEFAULT)
|
|
681
|
+
.template_param(new_parameter(top_up_id, key: 'top_up_id')
|
|
682
|
+
.is_required(true)
|
|
683
|
+
.should_encode(true))
|
|
684
|
+
.template_param(new_parameter(external_customer_id, key: 'external_customer_id')
|
|
685
|
+
.should_encode(true))
|
|
686
|
+
.auth(Single.new('APIKeyAuth')))
|
|
687
|
+
.response(new_response_handler
|
|
688
|
+
.is_response_void(true)
|
|
689
|
+
.is_api_response(true)
|
|
690
|
+
.local_error('400',
|
|
691
|
+
'Bad Request',
|
|
692
|
+
APIException)
|
|
693
|
+
.local_error('401',
|
|
694
|
+
'Unauthorized',
|
|
695
|
+
AuthorizationErrorException)
|
|
696
|
+
.local_error('404',
|
|
697
|
+
'Not Found',
|
|
698
|
+
APIException)
|
|
699
|
+
.local_error('409',
|
|
700
|
+
'Conflict',
|
|
701
|
+
IdempotencyRequestMismatchException)
|
|
702
|
+
.local_error('413',
|
|
703
|
+
'Content Too Large',
|
|
704
|
+
APIException)
|
|
705
|
+
.local_error('429',
|
|
706
|
+
'Too Many Requests',
|
|
707
|
+
TooManyRequestsException)
|
|
708
|
+
.local_error('500',
|
|
709
|
+
'Internal Server Error',
|
|
710
|
+
ServerErrorException))
|
|
711
|
+
.execute
|
|
712
|
+
end
|
|
713
|
+
|
|
714
|
+
# Returns a paginated list of unexpired, non-zero credit blocks for a
|
|
715
|
+
# customer.
|
|
716
|
+
# If `include_all_blocks` is set to `true`, all credit blocks (including
|
|
717
|
+
# expired and depleted blocks) will be included in
|
|
718
|
+
# the response.
|
|
719
|
+
# Note that `currency` defaults to credits if not specified. To use a real
|
|
720
|
+
# world currency, set `currency` to an ISO 4217 string.
|
|
721
|
+
# Results can be filtered by the block's `effective_date` using the
|
|
722
|
+
# `effective_date[gte]`, `effective_date[gt]`,
|
|
723
|
+
# `effective_date[lt]`, and `effective_date[lte]` query parameters. This
|
|
724
|
+
# filters on when the credit block
|
|
725
|
+
# becomes effective, which may differ from creation time for backdated
|
|
726
|
+
# credits.
|
|
727
|
+
# @param [String] customer_id Required parameter: TODO: type description
|
|
728
|
+
# here
|
|
729
|
+
# @param [Integer] limit Optional parameter: Example:20
|
|
730
|
+
# @param [String] cursor Optional parameter: TODO: type description here
|
|
731
|
+
# @param [String] currency Optional parameter: TODO: type description here
|
|
732
|
+
# @param [TrueClass | FalseClass] include_all_blocks Optional parameter:
|
|
733
|
+
# Example:false
|
|
734
|
+
# @param [DateTime] effective_date_gte Optional parameter: TODO: type
|
|
735
|
+
# description here
|
|
736
|
+
# @param [DateTime] effective_date_gt Optional parameter: TODO: type
|
|
737
|
+
# description here
|
|
738
|
+
# @param [DateTime] effective_date_lt Optional parameter: TODO: type
|
|
739
|
+
# description here
|
|
740
|
+
# @param [DateTime] effective_date_lte Optional parameter: TODO: type
|
|
741
|
+
# description here
|
|
742
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
743
|
+
def fetch_customer_credits(customer_id: nil,
|
|
744
|
+
limit: 20,
|
|
745
|
+
cursor: nil,
|
|
746
|
+
currency: nil,
|
|
747
|
+
include_all_blocks: false,
|
|
748
|
+
effective_date_gte: nil,
|
|
749
|
+
effective_date_gt: nil,
|
|
750
|
+
effective_date_lt: nil,
|
|
751
|
+
effective_date_lte: nil)
|
|
752
|
+
@api_call
|
|
753
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
754
|
+
'/customers/{customer_id}/credits',
|
|
755
|
+
Server::DEFAULT)
|
|
756
|
+
.template_param(new_parameter(customer_id, key: 'customer_id')
|
|
757
|
+
.should_encode(true))
|
|
758
|
+
.query_param(new_parameter(limit, key: 'limit'))
|
|
759
|
+
.query_param(new_parameter(cursor, key: 'cursor'))
|
|
760
|
+
.query_param(new_parameter(currency, key: 'currency'))
|
|
761
|
+
.query_param(new_parameter(include_all_blocks, key: 'include_all_blocks'))
|
|
762
|
+
.query_param(new_parameter(effective_date_gte, key: 'effective_date[gte]'))
|
|
763
|
+
.query_param(new_parameter(effective_date_gt, key: 'effective_date[gt]'))
|
|
764
|
+
.query_param(new_parameter(effective_date_lt, key: 'effective_date[lt]'))
|
|
765
|
+
.query_param(new_parameter(effective_date_lte, key: 'effective_date[lte]'))
|
|
766
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
767
|
+
.auth(Single.new('APIKeyAuth')))
|
|
768
|
+
.response(new_response_handler
|
|
769
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
770
|
+
.deserialize_into(CustomerCreditBalances.method(:from_hash))
|
|
771
|
+
.is_api_response(true)
|
|
772
|
+
.local_error('400',
|
|
773
|
+
'Bad Request',
|
|
774
|
+
APIException)
|
|
775
|
+
.local_error('401',
|
|
776
|
+
'Unauthorized',
|
|
777
|
+
AuthorizationErrorException)
|
|
778
|
+
.local_error('404',
|
|
779
|
+
'Not Found',
|
|
780
|
+
APIException)
|
|
781
|
+
.local_error('409',
|
|
782
|
+
'Conflict',
|
|
783
|
+
IdempotencyRequestMismatchException)
|
|
784
|
+
.local_error('413',
|
|
785
|
+
'Content Too Large',
|
|
786
|
+
APIException)
|
|
787
|
+
.local_error('429',
|
|
788
|
+
'Too Many Requests',
|
|
789
|
+
TooManyRequestsException)
|
|
790
|
+
.local_error('500',
|
|
791
|
+
'Internal Server Error',
|
|
792
|
+
ServerErrorException))
|
|
793
|
+
.execute
|
|
794
|
+
end
|
|
795
|
+
|
|
796
|
+
# The credits ledger provides _auditing_ functionality over Orb's credits
|
|
797
|
+
# system with a list of actions that have
|
|
798
|
+
# taken place to modify a customer's credit balance. This [paginated
|
|
799
|
+
# endpoint](/api-reference/pagination) lists these
|
|
800
|
+
# entries, starting from the most recent ledger entry.
|
|
801
|
+
# More details on using Orb's real-time credit feature are
|
|
802
|
+
# [here](/product-catalog/prepurchase).
|
|
803
|
+
# There are four major types of modifications to credit balance, detailed
|
|
804
|
+
# below.
|
|
805
|
+
# ## Increment
|
|
806
|
+
# Credits (which optionally expire on a future date) can be added via the
|
|
807
|
+
# API
|
|
808
|
+
# ([Add Ledger Entry](create-ledger-entry)). The ledger entry for such an
|
|
809
|
+
# action will always contain the total
|
|
810
|
+
# eligible starting and ending balance for the customer at the time the
|
|
811
|
+
# entry was added to the ledger.
|
|
812
|
+
# ## Decrement
|
|
813
|
+
# Deductions can occur as a result of an API call to create a ledger entry
|
|
814
|
+
# (see
|
|
815
|
+
# [Add Ledger Entry](create-ledger-entry)), or automatically as a result of
|
|
816
|
+
# incurring usage. Both ledger entries
|
|
817
|
+
# present the `decrement` entry type.
|
|
818
|
+
# As usage for a customer is reported into Orb, credits may be deducted
|
|
819
|
+
# according to the customer's plan
|
|
820
|
+
# configuration. An automated deduction of this type will result in a ledger
|
|
821
|
+
# entry, also with a starting and ending
|
|
822
|
+
# balance. Each day's usage for a particular price, invoice, and block will
|
|
823
|
+
# be grouped into a single entry.
|
|
824
|
+
# By default, Orb uses an algorithm that automatically deducts from the
|
|
825
|
+
# *soonest expiring credit block* first in
|
|
826
|
+
# order to ensure that all credits are utilized appropriately. As an
|
|
827
|
+
# example, if trial credits with an expiration date
|
|
828
|
+
# of 2 weeks from now are present for a customer, they will be used before
|
|
829
|
+
# any deductions take place from a
|
|
830
|
+
# non-expiring credit block.
|
|
831
|
+
# If there are multiple blocks with the same expiration date, Orb will
|
|
832
|
+
# deduct from the block with the
|
|
833
|
+
# *lower cost basis* first (e.g. trial credits with a \$0 cost basis before
|
|
834
|
+
# paid credits with a \$5.00 cost basis).
|
|
835
|
+
# It's also possible for a single usage event's deduction to _span_ credit
|
|
836
|
+
# blocks. In this case, Orb will deduct from
|
|
837
|
+
# the next block, ending at the credit block which consists of unexpiring
|
|
838
|
+
# credits. Each of these deductions will lead
|
|
839
|
+
# to a _separate_ ledger entry, one per credit block that is deducted from.
|
|
840
|
+
# By default, the customer's total credit
|
|
841
|
+
# balance in Orb can be negative as a result of a decrement.
|
|
842
|
+
# ## Expiration change
|
|
843
|
+
# The expiry of credits can be changed as a result of the API (See [Add
|
|
844
|
+
# Ledger Entry](create-ledger-entry)). This will
|
|
845
|
+
# create a ledger entry that specifies the balance as well as the initial
|
|
846
|
+
# and target expiry dates.
|
|
847
|
+
# Note that for this entry type, `starting_balance` will equal
|
|
848
|
+
# `ending_balance`, and the `amount` represents the
|
|
849
|
+
# balance transferred. The credit block linked to the ledger entry is the
|
|
850
|
+
# source credit block from which there was an
|
|
851
|
+
# expiration change.
|
|
852
|
+
# ## Credits expiry
|
|
853
|
+
# When a set of credits expire on pre-set expiration date, the customer's
|
|
854
|
+
# balance automatically reflects this change
|
|
855
|
+
# and adds an entry to the ledger indicating this event. Note that credit
|
|
856
|
+
# expiry should always happen close to a date
|
|
857
|
+
# boundary in the customer's timezone.
|
|
858
|
+
# ## Void initiated
|
|
859
|
+
# Credit blocks can be voided via the API. The `amount` on this entry
|
|
860
|
+
# corresponds to the number of credits that were
|
|
861
|
+
# remaining in the block at time of void. `void_reason` will be populated if
|
|
862
|
+
# the void is created with a reason.
|
|
863
|
+
# ## Void
|
|
864
|
+
# When a set of credits is voided, the customer's balance automatically
|
|
865
|
+
# reflects this change and adds an entry to the
|
|
866
|
+
# ledger indicating this event.
|
|
867
|
+
# ## Amendment
|
|
868
|
+
# When credits are added to a customer's balance as a result of a
|
|
869
|
+
# correction, this entry will be added to the ledger
|
|
870
|
+
# to indicate the adjustment of credits.
|
|
871
|
+
# @param [String] customer_id Required parameter: TODO: type description
|
|
872
|
+
# here
|
|
873
|
+
# @param [Integer] limit Optional parameter: Example:20
|
|
874
|
+
# @param [String] cursor Optional parameter: TODO: type description here
|
|
875
|
+
# @param [String] currency Optional parameter: TODO: type description here
|
|
876
|
+
# @param [String] minimum_amount Optional parameter: TODO: type description
|
|
877
|
+
# here
|
|
878
|
+
# @param [EntryType] entry_type Optional parameter: Example:
|
|
879
|
+
# @param [EntryStatus] entry_status Optional parameter: Example:
|
|
880
|
+
# @param [DateTime] created_at_gte Optional parameter: TODO: type
|
|
881
|
+
# description here
|
|
882
|
+
# @param [DateTime] created_at_gt Optional parameter: TODO: type description
|
|
883
|
+
# here
|
|
884
|
+
# @param [DateTime] created_at_lt Optional parameter: TODO: type description
|
|
885
|
+
# here
|
|
886
|
+
# @param [DateTime] created_at_lte Optional parameter: TODO: type
|
|
887
|
+
# description here
|
|
888
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
889
|
+
def fetch_customer_credits_ledger(customer_id: nil,
|
|
890
|
+
limit: 20,
|
|
891
|
+
cursor: nil,
|
|
892
|
+
currency: nil,
|
|
893
|
+
minimum_amount: nil,
|
|
894
|
+
entry_type: nil,
|
|
895
|
+
entry_status: nil,
|
|
896
|
+
created_at_gte: nil,
|
|
897
|
+
created_at_gt: nil,
|
|
898
|
+
created_at_lt: nil,
|
|
899
|
+
created_at_lte: nil)
|
|
900
|
+
@api_call
|
|
901
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
902
|
+
'/customers/{customer_id}/credits/ledger',
|
|
903
|
+
Server::DEFAULT)
|
|
904
|
+
.template_param(new_parameter(customer_id, key: 'customer_id')
|
|
905
|
+
.should_encode(true))
|
|
906
|
+
.query_param(new_parameter(limit, key: 'limit'))
|
|
907
|
+
.query_param(new_parameter(cursor, key: 'cursor'))
|
|
908
|
+
.query_param(new_parameter(currency, key: 'currency'))
|
|
909
|
+
.query_param(new_parameter(minimum_amount, key: 'minimum_amount'))
|
|
910
|
+
.query_param(new_parameter(entry_type, key: 'entry_type'))
|
|
911
|
+
.query_param(new_parameter(entry_status, key: 'entry_status'))
|
|
912
|
+
.query_param(new_parameter(created_at_gte, key: 'created_at[gte]'))
|
|
913
|
+
.query_param(new_parameter(created_at_gt, key: 'created_at[gt]'))
|
|
914
|
+
.query_param(new_parameter(created_at_lt, key: 'created_at[lt]'))
|
|
915
|
+
.query_param(new_parameter(created_at_lte, key: 'created_at[lte]'))
|
|
916
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
917
|
+
.auth(Single.new('APIKeyAuth')))
|
|
918
|
+
.response(new_response_handler
|
|
919
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
920
|
+
.deserialize_into(CreditLedgerEntries.method(:from_hash))
|
|
921
|
+
.is_api_response(true)
|
|
922
|
+
.local_error('400',
|
|
923
|
+
'Bad Request',
|
|
924
|
+
APIException)
|
|
925
|
+
.local_error('401',
|
|
926
|
+
'Unauthorized',
|
|
927
|
+
AuthorizationErrorException)
|
|
928
|
+
.local_error('404',
|
|
929
|
+
'Not Found',
|
|
930
|
+
APIException)
|
|
931
|
+
.local_error('409',
|
|
932
|
+
'Conflict',
|
|
933
|
+
IdempotencyRequestMismatchException)
|
|
934
|
+
.local_error('413',
|
|
935
|
+
'Content Too Large',
|
|
936
|
+
APIException)
|
|
937
|
+
.local_error('429',
|
|
938
|
+
'Too Many Requests',
|
|
939
|
+
TooManyRequestsException)
|
|
940
|
+
.local_error('500',
|
|
941
|
+
'Internal Server Error',
|
|
942
|
+
ServerErrorException))
|
|
943
|
+
.execute
|
|
944
|
+
end
|
|
945
|
+
|
|
946
|
+
# This endpoint allows you to create a new ledger entry for a specified
|
|
947
|
+
# customer's balance. This can be used to
|
|
948
|
+
# increment balance, deduct credits, and change the expiry date of existing
|
|
949
|
+
# credits.
|
|
950
|
+
# ## Effects of adding a ledger entry
|
|
951
|
+
# 1. After calling this endpoint, [Fetch Credit
|
|
952
|
+
# Balance](fetch-customer-credits) will return a credit block that
|
|
953
|
+
# represents the changes (i.e. balance changes or transfers).
|
|
954
|
+
# 2. A ledger entry will be added to the credits ledger for this customer,
|
|
955
|
+
# and therefore returned in the
|
|
956
|
+
# [View Credits Ledger](fetch-customer-credits-ledger) response as well as
|
|
957
|
+
# serialized in the response to this request. In
|
|
958
|
+
# the case of deductions without a specified block, multiple ledger
|
|
959
|
+
# entries may be created if the deduction spans
|
|
960
|
+
# credit blocks.
|
|
961
|
+
# 3. If `invoice_settings` is specified, an invoice will be created that
|
|
962
|
+
# reflects the cost of the credits (based on
|
|
963
|
+
# `amount` and `per_unit_cost_basis`).
|
|
964
|
+
# ## Adding credits
|
|
965
|
+
# Adding credits is done by creating an entry of type `increment`. This
|
|
966
|
+
# requires the caller to specify a number of
|
|
967
|
+
# credits as well as an optional expiry date in `YYYY-MM-DD` format. Orb
|
|
968
|
+
# also recommends specifying a description
|
|
969
|
+
# to assist with auditing. When adding credits, the caller can also
|
|
970
|
+
# specify a cost basis per-credit, to indicate
|
|
971
|
+
# how much in USD a customer paid for a single credit in a block. This can
|
|
972
|
+
# later be used for revenue recognition.
|
|
973
|
+
# The following snippet illustrates a sample request body to increment
|
|
974
|
+
# credits which will expire in January of 2022.
|
|
975
|
+
# ```json
|
|
976
|
+
# {
|
|
977
|
+
# "entry_type": "increment",
|
|
978
|
+
# "amount": 100,
|
|
979
|
+
# "expiry_date": "2022-12-28",
|
|
980
|
+
# "per_unit_cost_basis": "0.20",
|
|
981
|
+
# "description": "Purchased 100 credits"
|
|
982
|
+
# }
|
|
983
|
+
# ```
|
|
984
|
+
# Note that an `increment` entry always creates a new credit block (defined
|
|
985
|
+
# by the optional `effective_date` and
|
|
986
|
+
# `expiry_date`); it never modifies an existing block.
|
|
987
|
+
# ### Invoicing for credits
|
|
988
|
+
# By default, Orb manipulates the credit ledger but does not charge for
|
|
989
|
+
# credits. However, if you pass
|
|
990
|
+
# `invoice_settings` in the body of this request, Orb will also generate a
|
|
991
|
+
# one-off invoice for the customer for the
|
|
992
|
+
# credits pre-purchase. Note that you _must_ provide the
|
|
993
|
+
# `per_unit_cost_basis`, since the total charges on the
|
|
994
|
+
# invoice are calculated by multiplying the cost basis with the number of
|
|
995
|
+
# credit units added. If you invoice or handle payment
|
|
996
|
+
# of credits outside of Orb (i.e. marketplace customers), set `mark_as_paid`
|
|
997
|
+
# in the `invoice_settings` to `true` to prevent
|
|
998
|
+
# duplicate invoicing effects.
|
|
999
|
+
# * if `per_unit_cost_basis` is greater than zero, an invoice will be
|
|
1000
|
+
# generated and `invoice_settings` must be included
|
|
1001
|
+
# * if `invoice_settings` is passed, one of either `custom_due_date` or
|
|
1002
|
+
# `net_terms` is required to determine the due date
|
|
1003
|
+
# ## Deducting Credits
|
|
1004
|
+
# Orb allows you to deduct credits from a customer by creating an entry of
|
|
1005
|
+
# type `decrement`. A `decrement` entry
|
|
1006
|
+
# records credits as usage and immediately recognizes revenue at the block's
|
|
1007
|
+
# `per_unit_cost_basis`.
|
|
1008
|
+
# For most credit removals, use `void` (no revenue impact) or
|
|
1009
|
+
# `expiration_change` (revenue recognized on expiration)
|
|
1010
|
+
# instead. Only use `decrement` when credits were genuinely consumed outside
|
|
1011
|
+
# of normal event ingestion.
|
|
1012
|
+
# Orb matches the algorithm for automatic deductions for determining which
|
|
1013
|
+
# credit blocks to decrement from. In the
|
|
1014
|
+
# case that the deduction leads to multiple ledger entries, the response
|
|
1015
|
+
# from this endpoint will be the final
|
|
1016
|
+
# deduction. Orb also optionally allows specifying a description to assist
|
|
1017
|
+
# with auditing.
|
|
1018
|
+
# The following snippet illustrates a sample request body to decrement
|
|
1019
|
+
# credits.
|
|
1020
|
+
# ```json
|
|
1021
|
+
# {
|
|
1022
|
+
# "entry_type": "decrement",
|
|
1023
|
+
# "amount": 20,
|
|
1024
|
+
# "description": "Removing excess credits"
|
|
1025
|
+
# }
|
|
1026
|
+
# ```
|
|
1027
|
+
# ## Changing credits expiry
|
|
1028
|
+
# If you'd like to change when existing credits expire, you should create a
|
|
1029
|
+
# ledger entry of type `expiration_change`.
|
|
1030
|
+
# For this entry, the required parameter `expiry_date` identifies the
|
|
1031
|
+
# _originating_ block, and the required parameter
|
|
1032
|
+
# `target_expiry_date` identifies when the transferred credits should now
|
|
1033
|
+
# expire. A new credit block will be created
|
|
1034
|
+
# with expiry date `target_expiry_date`, with the same cost basis data as
|
|
1035
|
+
# the original credit block, if present.
|
|
1036
|
+
# Note that the balance of the block with the given `expiry_date` must be at
|
|
1037
|
+
# least equal to the desired transfer
|
|
1038
|
+
# amount determined by the `amount` parameter.
|
|
1039
|
+
# The following snippet illustrates a sample request body to extend the
|
|
1040
|
+
# expiration date of credits by one year:
|
|
1041
|
+
# ```json
|
|
1042
|
+
# {
|
|
1043
|
+
# "entry_type": "expiration_change",
|
|
1044
|
+
# "amount": 10,
|
|
1045
|
+
# "expiry_date": "2022-12-28",
|
|
1046
|
+
# "block_id": "UiUhFWeLHPrBY4Ad",
|
|
1047
|
+
# "target_expiry_date": "2023-12-28",
|
|
1048
|
+
# "description": "Extending credit validity"
|
|
1049
|
+
# }
|
|
1050
|
+
# ```
|
|
1051
|
+
# ## Voiding credits
|
|
1052
|
+
# If you'd like to void a credit block, create a ledger entry of type
|
|
1053
|
+
# `void`. For this entry, `block_id` is required
|
|
1054
|
+
# to identify the block, and `amount` indicates how many credits to void, up
|
|
1055
|
+
# to the block's initial balance. Pass
|
|
1056
|
+
# in a `void_reason` of `refund` if the void is due to a refund.
|
|
1057
|
+
# ## Amendment
|
|
1058
|
+
# If you'd like to undo a decrement on a credit block, create a ledger entry
|
|
1059
|
+
# of type `amendment`. For this entry, `block_id`
|
|
1060
|
+
# is required to identify the block that was originally decremented from,
|
|
1061
|
+
# and `amount` indicates how many credits to return
|
|
1062
|
+
# to the customer, up to the block's initial balance.
|
|
1063
|
+
# @param [String] customer_id Required parameter: TODO: type description
|
|
1064
|
+
# here
|
|
1065
|
+
# @param [AddIncrementCreditLedgerEntryRequestParams |
|
|
1066
|
+
# AddDecrementCreditLedgerEntryRequestParams |
|
|
1067
|
+
# AddExpirationChangeCreditLedgerEntryRequestParams |
|
|
1068
|
+
# AddVoidCreditLedgerEntryRequestParams |
|
|
1069
|
+
# AddAmendmentCreditLedgerEntryRequestParams] body Required parameter: TODO:
|
|
1070
|
+
# type description here
|
|
1071
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
1072
|
+
def create_ledger_entry(customer_id: nil,
|
|
1073
|
+
body)
|
|
1074
|
+
@api_call
|
|
1075
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
1076
|
+
'/customers/{customer_id}/credits/ledger_entry',
|
|
1077
|
+
Server::DEFAULT)
|
|
1078
|
+
.template_param(new_parameter(customer_id, key: 'customer_id')
|
|
1079
|
+
.should_encode(true))
|
|
1080
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
1081
|
+
.body_param(new_parameter(body)
|
|
1082
|
+
.is_required(true)
|
|
1083
|
+
.validator(proc do |value|
|
|
1084
|
+
UnionTypeLookUp.get(:AddCreditLedgerEntryRequestParams)
|
|
1085
|
+
.validate(value)
|
|
1086
|
+
end))
|
|
1087
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
1088
|
+
.body_serializer(APIHelper.method(:json_serialize))
|
|
1089
|
+
.auth(Single.new('APIKeyAuth')))
|
|
1090
|
+
.response(new_response_handler
|
|
1091
|
+
.deserializer(proc do |response, should_symbolize|
|
|
1092
|
+
APIHelper.deserialize_union_type(
|
|
1093
|
+
UnionTypeLookUp.get(:CreditLedgerEntry),
|
|
1094
|
+
response, should_symbolize, true
|
|
1095
|
+
)
|
|
1096
|
+
end)
|
|
1097
|
+
.is_api_response(true)
|
|
1098
|
+
.local_error('400',
|
|
1099
|
+
'Bad Request',
|
|
1100
|
+
APIException)
|
|
1101
|
+
.local_error('401',
|
|
1102
|
+
'Unauthorized',
|
|
1103
|
+
AuthorizationErrorException)
|
|
1104
|
+
.local_error('404',
|
|
1105
|
+
'Not Found',
|
|
1106
|
+
APIException)
|
|
1107
|
+
.local_error('409',
|
|
1108
|
+
'Conflict',
|
|
1109
|
+
IdempotencyRequestMismatchException)
|
|
1110
|
+
.local_error('413',
|
|
1111
|
+
'Content Too Large',
|
|
1112
|
+
APIException)
|
|
1113
|
+
.local_error('429',
|
|
1114
|
+
'Too Many Requests',
|
|
1115
|
+
TooManyRequestsException)
|
|
1116
|
+
.local_error('500',
|
|
1117
|
+
'Internal Server Error',
|
|
1118
|
+
ServerErrorException))
|
|
1119
|
+
.execute
|
|
1120
|
+
end
|
|
1121
|
+
|
|
1122
|
+
# TODO: type endpoint description here
|
|
1123
|
+
# @param [String] customer_id Required parameter: TODO: type description
|
|
1124
|
+
# here
|
|
1125
|
+
# @param [Integer] limit Optional parameter: Example:20
|
|
1126
|
+
# @param [String] cursor Optional parameter: TODO: type description here
|
|
1127
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
1128
|
+
def list_top_ups(customer_id: nil,
|
|
1129
|
+
limit: 20,
|
|
1130
|
+
cursor: nil)
|
|
1131
|
+
@api_call
|
|
1132
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
1133
|
+
'/customers/{customer_id}/credits/top_ups',
|
|
1134
|
+
Server::DEFAULT)
|
|
1135
|
+
.template_param(new_parameter(customer_id, key: 'customer_id')
|
|
1136
|
+
.should_encode(true))
|
|
1137
|
+
.query_param(new_parameter(limit, key: 'limit'))
|
|
1138
|
+
.query_param(new_parameter(cursor, key: 'cursor'))
|
|
1139
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
1140
|
+
.auth(Single.new('APIKeyAuth')))
|
|
1141
|
+
.response(new_response_handler
|
|
1142
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
1143
|
+
.deserialize_into(TopUps.method(:from_hash))
|
|
1144
|
+
.is_api_response(true)
|
|
1145
|
+
.local_error('400',
|
|
1146
|
+
'Bad Request',
|
|
1147
|
+
APIException)
|
|
1148
|
+
.local_error('401',
|
|
1149
|
+
'Unauthorized',
|
|
1150
|
+
AuthorizationErrorException)
|
|
1151
|
+
.local_error('404',
|
|
1152
|
+
'Not Found',
|
|
1153
|
+
APIException)
|
|
1154
|
+
.local_error('409',
|
|
1155
|
+
'Conflict',
|
|
1156
|
+
IdempotencyRequestMismatchException)
|
|
1157
|
+
.local_error('413',
|
|
1158
|
+
'Content Too Large',
|
|
1159
|
+
APIException)
|
|
1160
|
+
.local_error('429',
|
|
1161
|
+
'Too Many Requests',
|
|
1162
|
+
TooManyRequestsException)
|
|
1163
|
+
.local_error('500',
|
|
1164
|
+
'Internal Server Error',
|
|
1165
|
+
ServerErrorException))
|
|
1166
|
+
.execute
|
|
1167
|
+
end
|
|
1168
|
+
|
|
1169
|
+
# This endpoint allows you to create a new top-up for a specified customer's
|
|
1170
|
+
# balance.
|
|
1171
|
+
# While this top-up is active, the customer's balance will added in
|
|
1172
|
+
# increments of
|
|
1173
|
+
# the specified amount whenever the balance reaches the specified threshold.
|
|
1174
|
+
# If a top-up already exists for this customer in the same currency,
|
|
1175
|
+
# the existing top-up will be replaced.
|
|
1176
|
+
# @param [String] customer_id Required parameter: TODO: type description
|
|
1177
|
+
# here
|
|
1178
|
+
# @param [AddCreditTopUpRequestParams] body Required parameter: TODO: type
|
|
1179
|
+
# description here
|
|
1180
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
1181
|
+
def create_top_up(customer_id: nil,
|
|
1182
|
+
body)
|
|
1183
|
+
@api_call
|
|
1184
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
1185
|
+
'/customers/{customer_id}/credits/top_ups',
|
|
1186
|
+
Server::DEFAULT)
|
|
1187
|
+
.template_param(new_parameter(customer_id, key: 'customer_id')
|
|
1188
|
+
.should_encode(true))
|
|
1189
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
1190
|
+
.body_param(new_parameter(body)
|
|
1191
|
+
.is_required(true))
|
|
1192
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
1193
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
1194
|
+
.auth(Single.new('APIKeyAuth')))
|
|
1195
|
+
.response(new_response_handler
|
|
1196
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
1197
|
+
.deserialize_into(TopUp.method(:from_hash))
|
|
1198
|
+
.is_api_response(true)
|
|
1199
|
+
.local_error('400',
|
|
1200
|
+
'Bad Request',
|
|
1201
|
+
APIException)
|
|
1202
|
+
.local_error('401',
|
|
1203
|
+
'Unauthorized',
|
|
1204
|
+
AuthorizationErrorException)
|
|
1205
|
+
.local_error('404',
|
|
1206
|
+
'Not Found',
|
|
1207
|
+
APIException)
|
|
1208
|
+
.local_error('409',
|
|
1209
|
+
'Conflict',
|
|
1210
|
+
IdempotencyRequestMismatchException)
|
|
1211
|
+
.local_error('413',
|
|
1212
|
+
'Content Too Large',
|
|
1213
|
+
APIException)
|
|
1214
|
+
.local_error('429',
|
|
1215
|
+
'Too Many Requests',
|
|
1216
|
+
TooManyRequestsException)
|
|
1217
|
+
.local_error('500',
|
|
1218
|
+
'Internal Server Error',
|
|
1219
|
+
ServerErrorException))
|
|
1220
|
+
.execute
|
|
1221
|
+
end
|
|
1222
|
+
|
|
1223
|
+
# This deactivates the top-up and voids any invoices associated with pending
|
|
1224
|
+
# credit blocks purchased through the top-up.
|
|
1225
|
+
# @param [String] top_up_id Required parameter: TODO: type description
|
|
1226
|
+
# here
|
|
1227
|
+
# @param [String] customer_id Required parameter: TODO: type description
|
|
1228
|
+
# here
|
|
1229
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
1230
|
+
def delete_top_up(top_up_id,
|
|
1231
|
+
customer_id: nil)
|
|
1232
|
+
@api_call
|
|
1233
|
+
.request(new_request_builder(HttpMethodEnum::DELETE,
|
|
1234
|
+
'/customers/{customer_id}/credits/top_ups/{top_up_id}',
|
|
1235
|
+
Server::DEFAULT)
|
|
1236
|
+
.template_param(new_parameter(top_up_id, key: 'top_up_id')
|
|
1237
|
+
.is_required(true)
|
|
1238
|
+
.should_encode(true))
|
|
1239
|
+
.template_param(new_parameter(customer_id, key: 'customer_id')
|
|
1240
|
+
.should_encode(true))
|
|
1241
|
+
.auth(Single.new('APIKeyAuth')))
|
|
1242
|
+
.response(new_response_handler
|
|
1243
|
+
.is_response_void(true)
|
|
1244
|
+
.is_api_response(true)
|
|
1245
|
+
.local_error('400',
|
|
1246
|
+
'Bad Request',
|
|
1247
|
+
APIException)
|
|
1248
|
+
.local_error('401',
|
|
1249
|
+
'Unauthorized',
|
|
1250
|
+
AuthorizationErrorException)
|
|
1251
|
+
.local_error('404',
|
|
1252
|
+
'Not Found',
|
|
1253
|
+
APIException)
|
|
1254
|
+
.local_error('409',
|
|
1255
|
+
'Conflict',
|
|
1256
|
+
IdempotencyRequestMismatchException)
|
|
1257
|
+
.local_error('413',
|
|
1258
|
+
'Content Too Large',
|
|
1259
|
+
APIException)
|
|
1260
|
+
.local_error('429',
|
|
1261
|
+
'Too Many Requests',
|
|
1262
|
+
TooManyRequestsException)
|
|
1263
|
+
.local_error('500',
|
|
1264
|
+
'Internal Server Error',
|
|
1265
|
+
ServerErrorException))
|
|
1266
|
+
.execute
|
|
1267
|
+
end
|
|
1268
|
+
end
|
|
1269
|
+
end
|