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,1058 @@
|
|
|
1
|
+
# api_reference
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module ApiReference
|
|
7
|
+
# CustomerApi
|
|
8
|
+
class CustomerApi < BaseApi
|
|
9
|
+
# This endpoint returns a list of all customers for an account.
|
|
10
|
+
# The list of customers is ordered starting from the most recently created
|
|
11
|
+
# customer.
|
|
12
|
+
# This endpoint follows Orb's [standardized pagination
|
|
13
|
+
# format](/api-reference/pagination).
|
|
14
|
+
# See [Customer](/core-concepts##customer) for an overview of the customer
|
|
15
|
+
# model.
|
|
16
|
+
# @param [Integer] limit Optional parameter: Example:20
|
|
17
|
+
# @param [String] cursor Optional parameter: TODO: type description here
|
|
18
|
+
# @param [DateTime] created_at_gte Optional parameter: TODO: type
|
|
19
|
+
# description here
|
|
20
|
+
# @param [DateTime] created_at_gt Optional parameter: TODO: type description
|
|
21
|
+
# here
|
|
22
|
+
# @param [DateTime] created_at_lt Optional parameter: TODO: type description
|
|
23
|
+
# here
|
|
24
|
+
# @param [DateTime] created_at_lte Optional parameter: TODO: type
|
|
25
|
+
# description here
|
|
26
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
27
|
+
def list_customers(limit: 20,
|
|
28
|
+
cursor: nil,
|
|
29
|
+
created_at_gte: nil,
|
|
30
|
+
created_at_gt: nil,
|
|
31
|
+
created_at_lt: nil,
|
|
32
|
+
created_at_lte: nil)
|
|
33
|
+
@api_call
|
|
34
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
35
|
+
'/customers',
|
|
36
|
+
Server::DEFAULT)
|
|
37
|
+
.query_param(new_parameter(limit, key: 'limit'))
|
|
38
|
+
.query_param(new_parameter(cursor, key: 'cursor'))
|
|
39
|
+
.query_param(new_parameter(created_at_gte, key: 'created_at[gte]'))
|
|
40
|
+
.query_param(new_parameter(created_at_gt, key: 'created_at[gt]'))
|
|
41
|
+
.query_param(new_parameter(created_at_lt, key: 'created_at[lt]'))
|
|
42
|
+
.query_param(new_parameter(created_at_lte, key: 'created_at[lte]'))
|
|
43
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
44
|
+
.auth(Single.new('APIKeyAuth')))
|
|
45
|
+
.response(new_response_handler
|
|
46
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
47
|
+
.deserialize_into(Customers.method(:from_hash))
|
|
48
|
+
.is_api_response(true)
|
|
49
|
+
.local_error('400',
|
|
50
|
+
'Bad Request',
|
|
51
|
+
APIException)
|
|
52
|
+
.local_error('401',
|
|
53
|
+
'Unauthorized',
|
|
54
|
+
AuthorizationErrorException)
|
|
55
|
+
.local_error('404',
|
|
56
|
+
'Not Found',
|
|
57
|
+
APIException)
|
|
58
|
+
.local_error('409',
|
|
59
|
+
'Conflict',
|
|
60
|
+
IdempotencyRequestMismatchException)
|
|
61
|
+
.local_error('413',
|
|
62
|
+
'Content Too Large',
|
|
63
|
+
APIException)
|
|
64
|
+
.local_error('429',
|
|
65
|
+
'Too Many Requests',
|
|
66
|
+
TooManyRequestsException)
|
|
67
|
+
.local_error('500',
|
|
68
|
+
'Internal Server Error',
|
|
69
|
+
ServerErrorException))
|
|
70
|
+
.execute
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# This operation is used to create an Orb customer, who is party to the core
|
|
74
|
+
# billing relationship. See
|
|
75
|
+
# [Customer](/core-concepts##customer) for an overview of the customer
|
|
76
|
+
# resource.
|
|
77
|
+
# This endpoint is critical in the following Orb functionality:
|
|
78
|
+
# * Automated charges can be configured by setting `payment_provider` and
|
|
79
|
+
# `payment_provider_id` to automatically
|
|
80
|
+
# issue invoices
|
|
81
|
+
# * [Customer ID Aliases](/events-and-metrics/customer-aliases) can be
|
|
82
|
+
# configured by setting
|
|
83
|
+
# `external_customer_id`
|
|
84
|
+
# * [Timezone localization](/essentials/timezones) can be configured on a
|
|
85
|
+
# per-customer basis by
|
|
86
|
+
# setting the `timezone` parameter
|
|
87
|
+
# @param [NewCustomer] body Required parameter: TODO: type description
|
|
88
|
+
# here
|
|
89
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
90
|
+
def create_customer(body)
|
|
91
|
+
@api_call
|
|
92
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
93
|
+
'/customers',
|
|
94
|
+
Server::DEFAULT)
|
|
95
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
96
|
+
.body_param(new_parameter(body)
|
|
97
|
+
.is_required(true))
|
|
98
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
99
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
100
|
+
.auth(Single.new('APIKeyAuth')))
|
|
101
|
+
.response(new_response_handler
|
|
102
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
103
|
+
.deserialize_into(Customer.method(:from_hash))
|
|
104
|
+
.is_api_response(true)
|
|
105
|
+
.local_error('400',
|
|
106
|
+
'Bad Request',
|
|
107
|
+
APIException)
|
|
108
|
+
.local_error('401',
|
|
109
|
+
'Unauthorized',
|
|
110
|
+
AuthorizationErrorException)
|
|
111
|
+
.local_error('404',
|
|
112
|
+
'Not Found',
|
|
113
|
+
APIException)
|
|
114
|
+
.local_error('409',
|
|
115
|
+
'Conflict',
|
|
116
|
+
IdempotencyRequestMismatchException)
|
|
117
|
+
.local_error('413',
|
|
118
|
+
'Content Too Large',
|
|
119
|
+
APIException)
|
|
120
|
+
.local_error('429',
|
|
121
|
+
'Too Many Requests',
|
|
122
|
+
TooManyRequestsException)
|
|
123
|
+
.local_error('500',
|
|
124
|
+
'Internal Server Error',
|
|
125
|
+
ServerErrorException))
|
|
126
|
+
.execute
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# This endpoint is used to fetch customer details given an
|
|
130
|
+
# `external_customer_id` (see
|
|
131
|
+
# [Customer ID Aliases](/events-and-metrics/customer-aliases)).
|
|
132
|
+
# Note that the resource and semantics of this endpoint exactly mirror [Get
|
|
133
|
+
# Customer](fetch-customer).
|
|
134
|
+
# @param [String] external_customer_id Required parameter: TODO: type
|
|
135
|
+
# description here
|
|
136
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
137
|
+
def fetch_customer_external_id(external_customer_id)
|
|
138
|
+
@api_call
|
|
139
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
140
|
+
'/customers/external_customer_id/{external_customer_id}',
|
|
141
|
+
Server::DEFAULT)
|
|
142
|
+
.template_param(new_parameter(external_customer_id, key: 'external_customer_id')
|
|
143
|
+
.is_required(true)
|
|
144
|
+
.should_encode(true))
|
|
145
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
146
|
+
.auth(Single.new('APIKeyAuth')))
|
|
147
|
+
.response(new_response_handler
|
|
148
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
149
|
+
.deserialize_into(Customer.method(:from_hash))
|
|
150
|
+
.is_api_response(true)
|
|
151
|
+
.local_error('400',
|
|
152
|
+
'Bad Request',
|
|
153
|
+
APIException)
|
|
154
|
+
.local_error('401',
|
|
155
|
+
'Unauthorized',
|
|
156
|
+
AuthorizationErrorException)
|
|
157
|
+
.local_error('404',
|
|
158
|
+
'Not Found',
|
|
159
|
+
APIException)
|
|
160
|
+
.local_error('409',
|
|
161
|
+
'Conflict',
|
|
162
|
+
IdempotencyRequestMismatchException)
|
|
163
|
+
.local_error('413',
|
|
164
|
+
'Content Too Large',
|
|
165
|
+
APIException)
|
|
166
|
+
.local_error('429',
|
|
167
|
+
'Too Many Requests',
|
|
168
|
+
TooManyRequestsException)
|
|
169
|
+
.local_error('500',
|
|
170
|
+
'Internal Server Error',
|
|
171
|
+
ServerErrorException))
|
|
172
|
+
.execute
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# This endpoint is used to update customer details given an
|
|
176
|
+
# `external_customer_id`
|
|
177
|
+
# (see [Customer ID Aliases](/events-and-metrics/customer-aliases)).
|
|
178
|
+
# Note that the resource and semantics of this endpoint exactly mirror
|
|
179
|
+
# [Update Customer](update-customer).
|
|
180
|
+
# @param [String] external_customer_id Required parameter: TODO: type
|
|
181
|
+
# description here
|
|
182
|
+
# @param [EditCustomer] body Required parameter: TODO: type description
|
|
183
|
+
# here
|
|
184
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
185
|
+
def update_customer_external_id(external_customer_id,
|
|
186
|
+
body)
|
|
187
|
+
@api_call
|
|
188
|
+
.request(new_request_builder(HttpMethodEnum::PUT,
|
|
189
|
+
'/customers/external_customer_id/{external_customer_id}',
|
|
190
|
+
Server::DEFAULT)
|
|
191
|
+
.template_param(new_parameter(external_customer_id, key: 'external_customer_id')
|
|
192
|
+
.is_required(true)
|
|
193
|
+
.should_encode(true))
|
|
194
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
195
|
+
.body_param(new_parameter(body)
|
|
196
|
+
.is_required(true))
|
|
197
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
198
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
199
|
+
.auth(Single.new('APIKeyAuth')))
|
|
200
|
+
.response(new_response_handler
|
|
201
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
202
|
+
.deserialize_into(Customer.method(:from_hash))
|
|
203
|
+
.is_api_response(true)
|
|
204
|
+
.local_error('400',
|
|
205
|
+
'Bad Request',
|
|
206
|
+
APIException)
|
|
207
|
+
.local_error('401',
|
|
208
|
+
'Unauthorized',
|
|
209
|
+
AuthorizationErrorException)
|
|
210
|
+
.local_error('404',
|
|
211
|
+
'Not Found',
|
|
212
|
+
APIException)
|
|
213
|
+
.local_error('409',
|
|
214
|
+
'Conflict',
|
|
215
|
+
IdempotencyRequestMismatchException)
|
|
216
|
+
.local_error('413',
|
|
217
|
+
'Content Too Large',
|
|
218
|
+
APIException)
|
|
219
|
+
.local_error('429',
|
|
220
|
+
'Too Many Requests',
|
|
221
|
+
TooManyRequestsException)
|
|
222
|
+
.local_error('500',
|
|
223
|
+
'Internal Server Error',
|
|
224
|
+
ServerErrorException))
|
|
225
|
+
.execute
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# This endpoint is used to fetch a day-by-day snapshot of a customer's costs
|
|
229
|
+
# in Orb, calculated by applying pricing
|
|
230
|
+
# information to the underlying usage (see the [subscription usage
|
|
231
|
+
# endpoint](/api-reference/subscription/fetch-subscription-usage)
|
|
232
|
+
# to fetch usage per metric, in usage units rather than a currency).
|
|
233
|
+
# This endpoint can be leveraged for internal tooling and to provide a more
|
|
234
|
+
# transparent billing experience for your
|
|
235
|
+
# end users:
|
|
236
|
+
# 1. Understand the cost breakdown per line item historically and in
|
|
237
|
+
# real-time for the current billing period.
|
|
238
|
+
# 2. Provide customer visibility into how different services are
|
|
239
|
+
# contributing to the overall invoice with a per-day
|
|
240
|
+
# timeseries (as compared to the [upcoming
|
|
241
|
+
# invoice](/api-reference/invoice/fetch-upcoming-invoice) resource,
|
|
242
|
+
# which represents a snapshot for the current period).
|
|
243
|
+
# 3. Assess how minimums and discounts affect your customers by teasing
|
|
244
|
+
# apart costs directly as a result of usage,
|
|
245
|
+
# as opposed to minimums and discounts at the plan and price level.
|
|
246
|
+
# 4. Gain insight into key customer health metrics, such as the percent
|
|
247
|
+
# utilization of the minimum committed spend.
|
|
248
|
+
# ## Fetching subscriptions
|
|
249
|
+
# By default, this endpoint fetches the currently active subscription for
|
|
250
|
+
# the customer, and returns cost information
|
|
251
|
+
# for the subscription's current billing period, broken down by each
|
|
252
|
+
# participating price. If there are no currently
|
|
253
|
+
# active subscriptions, this will instead default to the most recently
|
|
254
|
+
# active subscription or return an empty series
|
|
255
|
+
# if none are found. For example, if your plan charges for compute hours,
|
|
256
|
+
# job runs, and data syncs, then this endpoint
|
|
257
|
+
# would provide a daily breakdown of your customer's cost for each of those
|
|
258
|
+
# axes.
|
|
259
|
+
# If timeframe bounds are specified, Orb fetches all subscriptions that were
|
|
260
|
+
# active in that timeframe. If two
|
|
261
|
+
# subscriptions overlap on a single day, costs from each price will be
|
|
262
|
+
# summed, and prices for both subscriptions will
|
|
263
|
+
# be included in the breakdown.
|
|
264
|
+
# ## Prepaid plans
|
|
265
|
+
# For plans that include prices which deduct credits rather than accrue
|
|
266
|
+
# in-arrears charges in a billable currency,
|
|
267
|
+
# this endpoint will return the total deduction amount, in credits, for the
|
|
268
|
+
# specified timeframe.
|
|
269
|
+
# ## Cumulative subtotals and totals
|
|
270
|
+
# Since the subtotal and total must factor in any billing-period level
|
|
271
|
+
# discounts and minimums, it's most meaningful
|
|
272
|
+
# to consider costs relative to the start of the subscription's billing
|
|
273
|
+
# period. As a result, by default this endpoint
|
|
274
|
+
# returns cumulative totals since the beginning of the billing period. In
|
|
275
|
+
# particular, the `timeframe_start` of a
|
|
276
|
+
# returned timeframe window is *always* the beginning of the billing period
|
|
277
|
+
# and `timeframe_end` is incremented one day
|
|
278
|
+
# at a time to build the result.
|
|
279
|
+
# A customer that uses a few API calls a day but has a minimum commitment
|
|
280
|
+
# might exhibit the following pattern for
|
|
281
|
+
# their subtotal and total in the first few days of the month. Here, we
|
|
282
|
+
# assume that each API call is \$2.50, the
|
|
283
|
+
# customer's plan has a monthly minimum of \$50 for this price, and that the
|
|
284
|
+
# subscription's billing period bounds are
|
|
285
|
+
# aligned to the first of the month:
|
|
286
|
+
# | timeframe_start | timeframe_end | Cumulative usage | Subtotal | Total
|
|
287
|
+
# (incl. commitment) |
|
|
288
|
+
# | -----------| ----------- | ----------- | ----------- |----------- |
|
|
289
|
+
# | 2023-02-01 | 2023-02-02 | 9 | \$22.50 | \$50.00 |
|
|
290
|
+
# | 2023-02-01 | 2023-02-03 | 19 | \$47.50 | \$50.00 |
|
|
291
|
+
# | 2023-02-01 | 2023-02-04 | 20 | \$50.00 | \$50.00 |
|
|
292
|
+
# | 2023-02-01 | 2023-02-05 | 28 | \$70.00 | \$70.00 |
|
|
293
|
+
# | 2023-02-01 | 2023-02-06 | 36 | \$90.00 | \$90.00 |
|
|
294
|
+
# ### Periodic values
|
|
295
|
+
# When the query parameter `view_mode=periodic` is specified, Orb will
|
|
296
|
+
# return an incremental day-by-day view of costs.
|
|
297
|
+
# In this case, there will always be a one-day difference between
|
|
298
|
+
# `timeframe_start` and `timeframe_end` for the
|
|
299
|
+
# timeframes returned. This is a transform on top of the cumulative costs,
|
|
300
|
+
# calculated by taking the difference of each
|
|
301
|
+
# timeframe with the last. Note that in the above example, the `Total` value
|
|
302
|
+
# would be 0 for the second two data
|
|
303
|
+
# points, since the minimum commitment has not yet been hit and each day is
|
|
304
|
+
# not contributing anything to the total
|
|
305
|
+
# cost.
|
|
306
|
+
# ## Timeframe bounds
|
|
307
|
+
# For an active subscription, both timeframes should be specified in the
|
|
308
|
+
# request. If a subscription starts or ends within the
|
|
309
|
+
# timeframe, the response will only include windows where the subscription
|
|
310
|
+
# is active. If a subscription has ended, no timeframe
|
|
311
|
+
# bounds need to be specified and the response will default to the billing
|
|
312
|
+
# period when the subscription was last active.
|
|
313
|
+
# As noted above, `timeframe_start` for a given cumulative datapoint is
|
|
314
|
+
# always the beginning of the billing period,
|
|
315
|
+
# and `timeframe_end` is incremented one day at a time to construct the
|
|
316
|
+
# response. When a timeframe is passed in that
|
|
317
|
+
# is not aligned to the current subscription's billing period, the response
|
|
318
|
+
# will contain cumulative totals from
|
|
319
|
+
# multiple billing periods.
|
|
320
|
+
# Suppose the queried customer has a subscription aligned to the 15th of
|
|
321
|
+
# every month. If this endpoint is queried with
|
|
322
|
+
# the date range `2023-06-01` - `2023-07-01`, the first data point will
|
|
323
|
+
# represent about half a billing period's worth
|
|
324
|
+
# of costs, accounting for accruals from the start of the billing period and
|
|
325
|
+
# inclusive of the first day of the
|
|
326
|
+
# timeframe (`timeframe_start = 2023-05-15 00:00:00`, `timeframe_end =
|
|
327
|
+
# 2023-06-02 00:00:00`)
|
|
328
|
+
# | datapoint index | timeframe_start | timeframe_end |
|
|
329
|
+
# | ----------- | -----------| ----------- |
|
|
330
|
+
# | 0 | 2023-05-15 | 2023-06-02 |
|
|
331
|
+
# | 1 | 2023-05-15 | 2023-06-03 |
|
|
332
|
+
# | 2 | ... | ... |
|
|
333
|
+
# | 3 | 2023-05-15 | 2023-06-14 |
|
|
334
|
+
# | 4 | 2023-06-15 | 2023-06-16 |
|
|
335
|
+
# | 5 | 2023-06-15 | 2023-06-17 |
|
|
336
|
+
# | 6 | ... | ... |
|
|
337
|
+
# | 7 | 2023-06-15 | 2023-07-01 |
|
|
338
|
+
# You can see this sliced timeframe visualized
|
|
339
|
+
# [here](https://i.imgur.com/TXhYgme.png).
|
|
340
|
+
# ### Matrix prices
|
|
341
|
+
# When a price uses matrix pricing, it's important to view costs grouped by
|
|
342
|
+
# those matrix dimensions. Orb will return
|
|
343
|
+
# `price_groups` with the `grouping_key` and `secondary_grouping_key` based
|
|
344
|
+
# on the matrix price definition, for each
|
|
345
|
+
# `grouping_value` and `secondary_grouping_value` available.
|
|
346
|
+
# @param [String] external_customer_id Required parameter: TODO: type
|
|
347
|
+
# description here
|
|
348
|
+
# @param [DateTime] timeframe_start Optional parameter: TODO: type
|
|
349
|
+
# description here
|
|
350
|
+
# @param [DateTime] timeframe_end Optional parameter: TODO: type description
|
|
351
|
+
# here
|
|
352
|
+
# @param [ViewMode] view_mode Optional parameter: Example:
|
|
353
|
+
# @param [String] currency Optional parameter: TODO: type description here
|
|
354
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
355
|
+
def fetch_customer_costs_external_id(external_customer_id: nil,
|
|
356
|
+
timeframe_start: nil,
|
|
357
|
+
timeframe_end: nil,
|
|
358
|
+
view_mode: nil,
|
|
359
|
+
currency: nil)
|
|
360
|
+
@api_call
|
|
361
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
362
|
+
'/customers/external_customer_id/{external_customer_id}/costs',
|
|
363
|
+
Server::DEFAULT)
|
|
364
|
+
.template_param(new_parameter(external_customer_id, key: 'external_customer_id')
|
|
365
|
+
.should_encode(true))
|
|
366
|
+
.query_param(new_parameter(timeframe_start, key: 'timeframe_start'))
|
|
367
|
+
.query_param(new_parameter(timeframe_end, key: 'timeframe_end'))
|
|
368
|
+
.query_param(new_parameter(view_mode, key: 'view_mode'))
|
|
369
|
+
.query_param(new_parameter(currency, key: 'currency'))
|
|
370
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
371
|
+
.auth(Single.new('APIKeyAuth')))
|
|
372
|
+
.response(new_response_handler
|
|
373
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
374
|
+
.deserialize_into(CustomerCosts.method(:from_hash))
|
|
375
|
+
.is_api_response(true)
|
|
376
|
+
.local_error('400',
|
|
377
|
+
'Bad Request',
|
|
378
|
+
APIException)
|
|
379
|
+
.local_error('401',
|
|
380
|
+
'Unauthorized',
|
|
381
|
+
AuthorizationErrorException)
|
|
382
|
+
.local_error('404',
|
|
383
|
+
'Not Found',
|
|
384
|
+
APIException)
|
|
385
|
+
.local_error('409',
|
|
386
|
+
'Conflict',
|
|
387
|
+
IdempotencyRequestMismatchException)
|
|
388
|
+
.local_error('413',
|
|
389
|
+
'Content Too Large',
|
|
390
|
+
APIException)
|
|
391
|
+
.local_error('429',
|
|
392
|
+
'Too Many Requests',
|
|
393
|
+
TooManyRequestsException)
|
|
394
|
+
.local_error('500',
|
|
395
|
+
'Internal Server Error',
|
|
396
|
+
ServerErrorException))
|
|
397
|
+
.execute
|
|
398
|
+
end
|
|
399
|
+
|
|
400
|
+
# Creates a portal session for the customer, returning a short-lived URL
|
|
401
|
+
# that provides
|
|
402
|
+
# authenticated access to the customer's billing portal. The session expires
|
|
403
|
+
# after
|
|
404
|
+
# `expires_in_minutes` (default 60, max 180). By default, creating a new
|
|
405
|
+
# session invalidates
|
|
406
|
+
# any other active portal sessions for the customer; pass
|
|
407
|
+
# `invalidate_existing=false` to
|
|
408
|
+
# allow concurrent sessions.
|
|
409
|
+
# @param [String] external_customer_id Required parameter: TODO: type
|
|
410
|
+
# description here
|
|
411
|
+
# @param [NewPortalSession] body Required parameter: TODO: type description
|
|
412
|
+
# here
|
|
413
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
414
|
+
def create_customer_portal_session_by_external_id(external_customer_id: nil,
|
|
415
|
+
body)
|
|
416
|
+
@api_call
|
|
417
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
418
|
+
'/customers/external_customer_id/{external_customer_id}/portal_sessions',
|
|
419
|
+
Server::DEFAULT)
|
|
420
|
+
.template_param(new_parameter(external_customer_id, key: 'external_customer_id')
|
|
421
|
+
.should_encode(true))
|
|
422
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
423
|
+
.body_param(new_parameter(body)
|
|
424
|
+
.is_required(true))
|
|
425
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
426
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
427
|
+
.auth(Single.new('APIKeyAuth')))
|
|
428
|
+
.response(new_response_handler
|
|
429
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
430
|
+
.deserialize_into(PortalSession.method(:from_hash))
|
|
431
|
+
.is_api_response(true)
|
|
432
|
+
.local_error('400',
|
|
433
|
+
'Bad Request',
|
|
434
|
+
APIException)
|
|
435
|
+
.local_error('401',
|
|
436
|
+
'Unauthorized',
|
|
437
|
+
AuthorizationErrorException)
|
|
438
|
+
.local_error('404',
|
|
439
|
+
'Not Found',
|
|
440
|
+
APIException)
|
|
441
|
+
.local_error('409',
|
|
442
|
+
'Conflict',
|
|
443
|
+
IdempotencyRequestMismatchException)
|
|
444
|
+
.local_error('413',
|
|
445
|
+
'Content Too Large',
|
|
446
|
+
APIException)
|
|
447
|
+
.local_error('429',
|
|
448
|
+
'Too Many Requests',
|
|
449
|
+
TooManyRequestsException)
|
|
450
|
+
.local_error('500',
|
|
451
|
+
'Internal Server Error',
|
|
452
|
+
ServerErrorException))
|
|
453
|
+
.execute
|
|
454
|
+
end
|
|
455
|
+
|
|
456
|
+
# Sync Orb's payment methods for the customer with their gateway.
|
|
457
|
+
# This method can be called before taking an action that may cause the
|
|
458
|
+
# customer to be charged, ensuring that the most up-to-date
|
|
459
|
+
# payment method is charged.
|
|
460
|
+
# **Note**: This functionality is currently only available for Stripe.
|
|
461
|
+
# @param [String] external_customer_id Required parameter: TODO: type
|
|
462
|
+
# description here
|
|
463
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
464
|
+
def sync_customer_payment_methods_from_gateway_by_external_id(external_customer_id: nil)
|
|
465
|
+
@api_call
|
|
466
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
467
|
+
'/customers/external_customer_id/{external_customer_id}/sync_payment_methods_from_gateway',
|
|
468
|
+
Server::DEFAULT)
|
|
469
|
+
.template_param(new_parameter(external_customer_id, key: 'external_customer_id')
|
|
470
|
+
.should_encode(true))
|
|
471
|
+
.auth(Single.new('APIKeyAuth')))
|
|
472
|
+
.response(new_response_handler
|
|
473
|
+
.is_response_void(true)
|
|
474
|
+
.is_api_response(true)
|
|
475
|
+
.local_error('400',
|
|
476
|
+
'Bad Request',
|
|
477
|
+
APIException)
|
|
478
|
+
.local_error('401',
|
|
479
|
+
'Unauthorized',
|
|
480
|
+
AuthorizationErrorException)
|
|
481
|
+
.local_error('404',
|
|
482
|
+
'Not Found',
|
|
483
|
+
APIException)
|
|
484
|
+
.local_error('409',
|
|
485
|
+
'Conflict',
|
|
486
|
+
IdempotencyRequestMismatchException)
|
|
487
|
+
.local_error('413',
|
|
488
|
+
'Content Too Large',
|
|
489
|
+
APIException)
|
|
490
|
+
.local_error('429',
|
|
491
|
+
'Too Many Requests',
|
|
492
|
+
TooManyRequestsException)
|
|
493
|
+
.local_error('500',
|
|
494
|
+
'Internal Server Error',
|
|
495
|
+
ServerErrorException))
|
|
496
|
+
.execute
|
|
497
|
+
end
|
|
498
|
+
|
|
499
|
+
# This endpoint is used to fetch customer details given an identifier. If
|
|
500
|
+
# the `Customer` is in the process of being deleted,
|
|
501
|
+
# only the properties `id` and `deleted: true` will be returned.
|
|
502
|
+
# See the [Customer resource](/core-concepts#customer) for a full discussion
|
|
503
|
+
# of the Customer model.
|
|
504
|
+
# @param [String] customer_id Required parameter: TODO: type description
|
|
505
|
+
# here
|
|
506
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
507
|
+
def fetch_customer(customer_id)
|
|
508
|
+
@api_call
|
|
509
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
510
|
+
'/customers/{customer_id}',
|
|
511
|
+
Server::DEFAULT)
|
|
512
|
+
.template_param(new_parameter(customer_id, key: 'customer_id')
|
|
513
|
+
.is_required(true)
|
|
514
|
+
.should_encode(true))
|
|
515
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
516
|
+
.auth(Single.new('APIKeyAuth')))
|
|
517
|
+
.response(new_response_handler
|
|
518
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
519
|
+
.deserialize_into(Customer.method(:from_hash))
|
|
520
|
+
.is_api_response(true)
|
|
521
|
+
.local_error('400',
|
|
522
|
+
'Bad Request',
|
|
523
|
+
APIException)
|
|
524
|
+
.local_error('401',
|
|
525
|
+
'Unauthorized',
|
|
526
|
+
AuthorizationErrorException)
|
|
527
|
+
.local_error('404',
|
|
528
|
+
'Not Found',
|
|
529
|
+
APIException)
|
|
530
|
+
.local_error('409',
|
|
531
|
+
'Conflict',
|
|
532
|
+
IdempotencyRequestMismatchException)
|
|
533
|
+
.local_error('413',
|
|
534
|
+
'Content Too Large',
|
|
535
|
+
APIException)
|
|
536
|
+
.local_error('429',
|
|
537
|
+
'Too Many Requests',
|
|
538
|
+
TooManyRequestsException)
|
|
539
|
+
.local_error('500',
|
|
540
|
+
'Internal Server Error',
|
|
541
|
+
ServerErrorException))
|
|
542
|
+
.execute
|
|
543
|
+
end
|
|
544
|
+
|
|
545
|
+
# This endpoint can be used to update the `payment_provider`,
|
|
546
|
+
# `payment_provider_id`, `name`, `email`, `email_delivery`, `tax_id`,
|
|
547
|
+
# `auto_collection`, `metadata`, `shipping_address`, `billing_address`,
|
|
548
|
+
# `additional_emails`, and `currency` of an existing
|
|
549
|
+
# customer. `currency` can only be set if it has not already been set on the
|
|
550
|
+
# customer. Other fields on a customer are currently
|
|
551
|
+
# immutable.
|
|
552
|
+
# @param [String] customer_id Required parameter: TODO: type description
|
|
553
|
+
# here
|
|
554
|
+
# @param [EditCustomer] body Required parameter: TODO: type description
|
|
555
|
+
# here
|
|
556
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
557
|
+
def update_customer(customer_id,
|
|
558
|
+
body)
|
|
559
|
+
@api_call
|
|
560
|
+
.request(new_request_builder(HttpMethodEnum::PUT,
|
|
561
|
+
'/customers/{customer_id}',
|
|
562
|
+
Server::DEFAULT)
|
|
563
|
+
.template_param(new_parameter(customer_id, key: 'customer_id')
|
|
564
|
+
.is_required(true)
|
|
565
|
+
.should_encode(true))
|
|
566
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
567
|
+
.body_param(new_parameter(body)
|
|
568
|
+
.is_required(true))
|
|
569
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
570
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
571
|
+
.auth(Single.new('APIKeyAuth')))
|
|
572
|
+
.response(new_response_handler
|
|
573
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
574
|
+
.deserialize_into(Customer.method(:from_hash))
|
|
575
|
+
.is_api_response(true)
|
|
576
|
+
.local_error('400',
|
|
577
|
+
'Bad Request',
|
|
578
|
+
APIException)
|
|
579
|
+
.local_error('401',
|
|
580
|
+
'Unauthorized',
|
|
581
|
+
AuthorizationErrorException)
|
|
582
|
+
.local_error('404',
|
|
583
|
+
'Not Found',
|
|
584
|
+
APIException)
|
|
585
|
+
.local_error('409',
|
|
586
|
+
'Conflict',
|
|
587
|
+
IdempotencyRequestMismatchException)
|
|
588
|
+
.local_error('413',
|
|
589
|
+
'Content Too Large',
|
|
590
|
+
APIException)
|
|
591
|
+
.local_error('429',
|
|
592
|
+
'Too Many Requests',
|
|
593
|
+
TooManyRequestsException)
|
|
594
|
+
.local_error('500',
|
|
595
|
+
'Internal Server Error',
|
|
596
|
+
ServerErrorException))
|
|
597
|
+
.execute
|
|
598
|
+
end
|
|
599
|
+
|
|
600
|
+
# This performs a deletion of this customer, its subscriptions, and its
|
|
601
|
+
# invoices, provided the customer does not have any issued
|
|
602
|
+
# invoices. Customers with issued invoices cannot be deleted. This operation
|
|
603
|
+
# is irreversible. Note that this
|
|
604
|
+
# is a _soft_ deletion, but the data will be inaccessible through the API
|
|
605
|
+
# and Orb dashboard.
|
|
606
|
+
# For a hard-deletion, please reach out to the Orb team directly.
|
|
607
|
+
# **Note**: This operation happens asynchronously and can be expected to
|
|
608
|
+
# take a
|
|
609
|
+
# few minutes to propagate to related resources. However, querying for the
|
|
610
|
+
# customer on
|
|
611
|
+
# subsequent GET requests while deletion is in process will reflect its
|
|
612
|
+
# deletion.
|
|
613
|
+
# @param [String] customer_id Required parameter: TODO: type description
|
|
614
|
+
# here
|
|
615
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
616
|
+
def delete_customer(customer_id)
|
|
617
|
+
@api_call
|
|
618
|
+
.request(new_request_builder(HttpMethodEnum::DELETE,
|
|
619
|
+
'/customers/{customer_id}',
|
|
620
|
+
Server::DEFAULT)
|
|
621
|
+
.template_param(new_parameter(customer_id, key: 'customer_id')
|
|
622
|
+
.is_required(true)
|
|
623
|
+
.should_encode(true))
|
|
624
|
+
.auth(Single.new('APIKeyAuth')))
|
|
625
|
+
.response(new_response_handler
|
|
626
|
+
.is_response_void(true)
|
|
627
|
+
.is_api_response(true)
|
|
628
|
+
.local_error('400',
|
|
629
|
+
'Bad Request',
|
|
630
|
+
APIException)
|
|
631
|
+
.local_error('401',
|
|
632
|
+
'Unauthorized',
|
|
633
|
+
AuthorizationErrorException)
|
|
634
|
+
.local_error('404',
|
|
635
|
+
'Not Found',
|
|
636
|
+
APIException)
|
|
637
|
+
.local_error('409',
|
|
638
|
+
'Conflict',
|
|
639
|
+
IdempotencyRequestMismatchException)
|
|
640
|
+
.local_error('413',
|
|
641
|
+
'Content Too Large',
|
|
642
|
+
APIException)
|
|
643
|
+
.local_error('429',
|
|
644
|
+
'Too Many Requests',
|
|
645
|
+
TooManyRequestsException)
|
|
646
|
+
.local_error('500',
|
|
647
|
+
'Internal Server Error',
|
|
648
|
+
ServerErrorException))
|
|
649
|
+
.execute
|
|
650
|
+
end
|
|
651
|
+
|
|
652
|
+
# ## The customer balance
|
|
653
|
+
# The customer balance is an amount in the customer's currency, which Orb
|
|
654
|
+
# automatically applies to subsequent
|
|
655
|
+
# invoices. This balance can be adjusted manually via Orb's webapp on the
|
|
656
|
+
# customer details page. You can use this
|
|
657
|
+
# balance to provide a fixed mid-period credit to the customer. Commonly,
|
|
658
|
+
# this is done due to system downtime/SLA
|
|
659
|
+
# violation, or an adhoc adjustment discussed with the customer.
|
|
660
|
+
# If the balance is a positive value at the time of invoicing, it represents
|
|
661
|
+
# that the customer has credit that should
|
|
662
|
+
# be used to offset the amount due on the next issued invoice. In this case,
|
|
663
|
+
# Orb will automatically reduce the next
|
|
664
|
+
# invoice by the balance amount, and roll over any remaining balance if the
|
|
665
|
+
# invoice is fully discounted.
|
|
666
|
+
# If the balance is a negative value at the time of invoicing, Orb will
|
|
667
|
+
# increase the invoice's amount due with a
|
|
668
|
+
# positive adjustment, and reset the balance to 0.
|
|
669
|
+
# This endpoint retrieves all customer balance transactions in reverse
|
|
670
|
+
# chronological order for a single customer,
|
|
671
|
+
# providing a complete audit trail of all adjustments and invoice
|
|
672
|
+
# applications.
|
|
673
|
+
# @param [String] customer_id Required parameter: TODO: type description
|
|
674
|
+
# here
|
|
675
|
+
# @param [Integer] limit Optional parameter: Example:20
|
|
676
|
+
# @param [String] cursor Optional parameter: TODO: type description here
|
|
677
|
+
# @param [DateTime] operation_time_gte Optional parameter: TODO: type
|
|
678
|
+
# description here
|
|
679
|
+
# @param [DateTime] operation_time_gt Optional parameter: TODO: type
|
|
680
|
+
# description here
|
|
681
|
+
# @param [DateTime] operation_time_lt Optional parameter: TODO: type
|
|
682
|
+
# description here
|
|
683
|
+
# @param [DateTime] operation_time_lte Optional parameter: TODO: type
|
|
684
|
+
# description here
|
|
685
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
686
|
+
def list_balance_transactions(customer_id,
|
|
687
|
+
limit: 20,
|
|
688
|
+
cursor: nil,
|
|
689
|
+
operation_time_gte: nil,
|
|
690
|
+
operation_time_gt: nil,
|
|
691
|
+
operation_time_lt: nil,
|
|
692
|
+
operation_time_lte: nil)
|
|
693
|
+
@api_call
|
|
694
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
695
|
+
'/customers/{customer_id}/balance_transactions',
|
|
696
|
+
Server::DEFAULT)
|
|
697
|
+
.template_param(new_parameter(customer_id, key: 'customer_id')
|
|
698
|
+
.is_required(true)
|
|
699
|
+
.should_encode(true))
|
|
700
|
+
.query_param(new_parameter(limit, key: 'limit'))
|
|
701
|
+
.query_param(new_parameter(cursor, key: 'cursor'))
|
|
702
|
+
.query_param(new_parameter(operation_time_gte, key: 'operation_time[gte]'))
|
|
703
|
+
.query_param(new_parameter(operation_time_gt, key: 'operation_time[gt]'))
|
|
704
|
+
.query_param(new_parameter(operation_time_lt, key: 'operation_time[lt]'))
|
|
705
|
+
.query_param(new_parameter(operation_time_lte, key: 'operation_time[lte]'))
|
|
706
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
707
|
+
.auth(Single.new('APIKeyAuth')))
|
|
708
|
+
.response(new_response_handler
|
|
709
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
710
|
+
.deserialize_into(CustomerBalanceTransactions.method(:from_hash))
|
|
711
|
+
.is_api_response(true)
|
|
712
|
+
.local_error('400',
|
|
713
|
+
'Bad Request',
|
|
714
|
+
APIException)
|
|
715
|
+
.local_error('401',
|
|
716
|
+
'Unauthorized',
|
|
717
|
+
AuthorizationErrorException)
|
|
718
|
+
.local_error('404',
|
|
719
|
+
'Not Found',
|
|
720
|
+
APIException)
|
|
721
|
+
.local_error('409',
|
|
722
|
+
'Conflict',
|
|
723
|
+
IdempotencyRequestMismatchException)
|
|
724
|
+
.local_error('413',
|
|
725
|
+
'Content Too Large',
|
|
726
|
+
APIException)
|
|
727
|
+
.local_error('429',
|
|
728
|
+
'Too Many Requests',
|
|
729
|
+
TooManyRequestsException)
|
|
730
|
+
.local_error('500',
|
|
731
|
+
'Internal Server Error',
|
|
732
|
+
ServerErrorException))
|
|
733
|
+
.execute
|
|
734
|
+
end
|
|
735
|
+
|
|
736
|
+
# Creates an immutable balance transaction that updates the customer's
|
|
737
|
+
# balance and returns back the newly created
|
|
738
|
+
# transaction.
|
|
739
|
+
# @param [String] customer_id Required parameter: TODO: type description
|
|
740
|
+
# here
|
|
741
|
+
# @param [NewCustomerBalanceTransaction] body Required parameter: TODO: type
|
|
742
|
+
# description here
|
|
743
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
744
|
+
def create_customer_balance_transaction(customer_id,
|
|
745
|
+
body)
|
|
746
|
+
@api_call
|
|
747
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
748
|
+
'/customers/{customer_id}/balance_transactions',
|
|
749
|
+
Server::DEFAULT)
|
|
750
|
+
.template_param(new_parameter(customer_id, key: 'customer_id')
|
|
751
|
+
.is_required(true)
|
|
752
|
+
.should_encode(true))
|
|
753
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
754
|
+
.body_param(new_parameter(body)
|
|
755
|
+
.is_required(true))
|
|
756
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
757
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
758
|
+
.auth(Single.new('APIKeyAuth')))
|
|
759
|
+
.response(new_response_handler
|
|
760
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
761
|
+
.deserialize_into(CustomerBalanceTransaction.method(:from_hash))
|
|
762
|
+
.is_api_response(true)
|
|
763
|
+
.local_error('400',
|
|
764
|
+
'Bad Request',
|
|
765
|
+
APIException)
|
|
766
|
+
.local_error('401',
|
|
767
|
+
'Unauthorized',
|
|
768
|
+
AuthorizationErrorException)
|
|
769
|
+
.local_error('404',
|
|
770
|
+
'Not Found',
|
|
771
|
+
APIException)
|
|
772
|
+
.local_error('409',
|
|
773
|
+
'Conflict',
|
|
774
|
+
IdempotencyRequestMismatchException)
|
|
775
|
+
.local_error('413',
|
|
776
|
+
'Content Too Large',
|
|
777
|
+
APIException)
|
|
778
|
+
.local_error('429',
|
|
779
|
+
'Too Many Requests',
|
|
780
|
+
TooManyRequestsException)
|
|
781
|
+
.local_error('500',
|
|
782
|
+
'Internal Server Error',
|
|
783
|
+
ServerErrorException))
|
|
784
|
+
.execute
|
|
785
|
+
end
|
|
786
|
+
|
|
787
|
+
# This endpoint is used to fetch a day-by-day snapshot of a customer's costs
|
|
788
|
+
# in Orb, calculated by applying pricing
|
|
789
|
+
# information to the underlying usage (see the [subscription usage
|
|
790
|
+
# endpoint](/api-reference/subscription/fetch-subscription-usage)
|
|
791
|
+
# to fetch usage per metric, in usage units rather than a currency).
|
|
792
|
+
# This endpoint can be leveraged for internal tooling and to provide a more
|
|
793
|
+
# transparent billing experience for your
|
|
794
|
+
# end users:
|
|
795
|
+
# 1. Understand the cost breakdown per line item historically and in
|
|
796
|
+
# real-time for the current billing period.
|
|
797
|
+
# 2. Provide customer visibility into how different services are
|
|
798
|
+
# contributing to the overall invoice with a per-day
|
|
799
|
+
# timeseries (as compared to the [upcoming
|
|
800
|
+
# invoice](/api-reference/invoice/fetch-upcoming-invoice) resource,
|
|
801
|
+
# which represents a snapshot for the current period).
|
|
802
|
+
# 3. Assess how minimums and discounts affect your customers by teasing
|
|
803
|
+
# apart costs directly as a result of usage,
|
|
804
|
+
# as opposed to minimums and discounts at the plan and price level.
|
|
805
|
+
# 4. Gain insight into key customer health metrics, such as the percent
|
|
806
|
+
# utilization of the minimum committed spend.
|
|
807
|
+
# ## Fetching subscriptions
|
|
808
|
+
# By default, this endpoint fetches the currently active subscription for
|
|
809
|
+
# the customer, and returns cost information
|
|
810
|
+
# for the subscription's current billing period, broken down by each
|
|
811
|
+
# participating price. If there are no currently
|
|
812
|
+
# active subscriptions, this will instead default to the most recently
|
|
813
|
+
# active subscription or return an empty series
|
|
814
|
+
# if none are found. For example, if your plan charges for compute hours,
|
|
815
|
+
# job runs, and data syncs, then this endpoint
|
|
816
|
+
# would provide a daily breakdown of your customer's cost for each of those
|
|
817
|
+
# axes.
|
|
818
|
+
# If timeframe bounds are specified, Orb fetches all subscriptions that were
|
|
819
|
+
# active in that timeframe. If two
|
|
820
|
+
# subscriptions overlap on a single day, costs from each price will be
|
|
821
|
+
# summed, and prices for both subscriptions will
|
|
822
|
+
# be included in the breakdown.
|
|
823
|
+
# ## Prepaid plans
|
|
824
|
+
# For plans that include prices which deduct credits rather than accrue
|
|
825
|
+
# in-arrears charges in a billable currency,
|
|
826
|
+
# this endpoint will return the total deduction amount, in credits, for the
|
|
827
|
+
# specified timeframe.
|
|
828
|
+
# ## Cumulative subtotals and totals
|
|
829
|
+
# Since the subtotal and total must factor in any billing-period level
|
|
830
|
+
# discounts and minimums, it's most meaningful
|
|
831
|
+
# to consider costs relative to the start of the subscription's billing
|
|
832
|
+
# period. As a result, by default this endpoint
|
|
833
|
+
# returns cumulative totals since the beginning of the billing period. In
|
|
834
|
+
# particular, the `timeframe_start` of a
|
|
835
|
+
# returned timeframe window is *always* the beginning of the billing period
|
|
836
|
+
# and `timeframe_end` is incremented one day
|
|
837
|
+
# at a time to build the result.
|
|
838
|
+
# A customer that uses a few API calls a day but has a minimum commitment
|
|
839
|
+
# might exhibit the following pattern for
|
|
840
|
+
# their subtotal and total in the first few days of the month. Here, we
|
|
841
|
+
# assume that each API call is \$2.50, the
|
|
842
|
+
# customer's plan has a monthly minimum of \$50 for this price, and that the
|
|
843
|
+
# subscription's billing period bounds are
|
|
844
|
+
# aligned to the first of the month:
|
|
845
|
+
# | timeframe_start | timeframe_end | Cumulative usage | Subtotal | Total
|
|
846
|
+
# (incl. commitment) |
|
|
847
|
+
# | -----------| ----------- | ----------- | ----------- |----------- |
|
|
848
|
+
# | 2023-02-01 | 2023-02-02 | 9 | \$22.50 | \$50.00 |
|
|
849
|
+
# | 2023-02-01 | 2023-02-03 | 19 | \$47.50 | \$50.00 |
|
|
850
|
+
# | 2023-02-01 | 2023-02-04 | 20 | \$50.00 | \$50.00 |
|
|
851
|
+
# | 2023-02-01 | 2023-02-05 | 28 | \$70.00 | \$70.00 |
|
|
852
|
+
# | 2023-02-01 | 2023-02-06 | 36 | \$90.00 | \$90.00 |
|
|
853
|
+
# ### Periodic values
|
|
854
|
+
# When the query parameter `view_mode=periodic` is specified, Orb will
|
|
855
|
+
# return an incremental day-by-day view of costs.
|
|
856
|
+
# In this case, there will always be a one-day difference between
|
|
857
|
+
# `timeframe_start` and `timeframe_end` for the
|
|
858
|
+
# timeframes returned. This is a transform on top of the cumulative costs,
|
|
859
|
+
# calculated by taking the difference of each
|
|
860
|
+
# timeframe with the last. Note that in the above example, the `Total` value
|
|
861
|
+
# would be 0 for the second two data
|
|
862
|
+
# points, since the minimum commitment has not yet been hit and each day is
|
|
863
|
+
# not contributing anything to the total
|
|
864
|
+
# cost.
|
|
865
|
+
# ## Timeframe bounds
|
|
866
|
+
# For an active subscription, both timeframes should be specified in the
|
|
867
|
+
# request. If a subscription starts or ends within the
|
|
868
|
+
# timeframe, the response will only include windows where the subscription
|
|
869
|
+
# is active. If a subscription has ended, no timeframe
|
|
870
|
+
# bounds need to be specified and the response will default to the billing
|
|
871
|
+
# period when the subscription was last active.
|
|
872
|
+
# As noted above, `timeframe_start` for a given cumulative datapoint is
|
|
873
|
+
# always the beginning of the billing period,
|
|
874
|
+
# and `timeframe_end` is incremented one day at a time to construct the
|
|
875
|
+
# response. When a timeframe is passed in that
|
|
876
|
+
# is not aligned to the current subscription's billing period, the response
|
|
877
|
+
# will contain cumulative totals from
|
|
878
|
+
# multiple billing periods.
|
|
879
|
+
# Suppose the queried customer has a subscription aligned to the 15th of
|
|
880
|
+
# every month. If this endpoint is queried with
|
|
881
|
+
# the date range `2023-06-01` - `2023-07-01`, the first data point will
|
|
882
|
+
# represent about half a billing period's worth
|
|
883
|
+
# of costs, accounting for accruals from the start of the billing period and
|
|
884
|
+
# inclusive of the first day of the
|
|
885
|
+
# timeframe (`timeframe_start = 2023-05-15 00:00:00`, `timeframe_end =
|
|
886
|
+
# 2023-06-02 00:00:00`)
|
|
887
|
+
# | datapoint index | timeframe_start | timeframe_end |
|
|
888
|
+
# | ----------- | -----------| ----------- |
|
|
889
|
+
# | 0 | 2023-05-15 | 2023-06-02 |
|
|
890
|
+
# | 1 | 2023-05-15 | 2023-06-03 |
|
|
891
|
+
# | 2 | ... | ... |
|
|
892
|
+
# | 3 | 2023-05-15 | 2023-06-14 |
|
|
893
|
+
# | 4 | 2023-06-15 | 2023-06-16 |
|
|
894
|
+
# | 5 | 2023-06-15 | 2023-06-17 |
|
|
895
|
+
# | 6 | ... | ... |
|
|
896
|
+
# | 7 | 2023-06-15 | 2023-07-01 |
|
|
897
|
+
# You can see this sliced timeframe visualized
|
|
898
|
+
# [here](https://i.imgur.com/TXhYgme.png).
|
|
899
|
+
# ### Matrix prices
|
|
900
|
+
# When a price uses matrix pricing, it's important to view costs grouped by
|
|
901
|
+
# those matrix dimensions. Orb will return
|
|
902
|
+
# `price_groups` with the `grouping_key` and `secondary_grouping_key` based
|
|
903
|
+
# on the matrix price definition, for each
|
|
904
|
+
# `grouping_value` and `secondary_grouping_value` available.
|
|
905
|
+
# @param [String] customer_id Required parameter: TODO: type description
|
|
906
|
+
# here
|
|
907
|
+
# @param [DateTime] timeframe_start Optional parameter: TODO: type
|
|
908
|
+
# description here
|
|
909
|
+
# @param [DateTime] timeframe_end Optional parameter: TODO: type description
|
|
910
|
+
# here
|
|
911
|
+
# @param [ViewMode] view_mode Optional parameter: Example:
|
|
912
|
+
# @param [String] currency Optional parameter: TODO: type description here
|
|
913
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
914
|
+
def fetch_customer_costs(customer_id: nil,
|
|
915
|
+
timeframe_start: nil,
|
|
916
|
+
timeframe_end: nil,
|
|
917
|
+
view_mode: nil,
|
|
918
|
+
currency: nil)
|
|
919
|
+
@api_call
|
|
920
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
921
|
+
'/customers/{customer_id}/costs',
|
|
922
|
+
Server::DEFAULT)
|
|
923
|
+
.template_param(new_parameter(customer_id, key: 'customer_id')
|
|
924
|
+
.should_encode(true))
|
|
925
|
+
.query_param(new_parameter(timeframe_start, key: 'timeframe_start'))
|
|
926
|
+
.query_param(new_parameter(timeframe_end, key: 'timeframe_end'))
|
|
927
|
+
.query_param(new_parameter(view_mode, key: 'view_mode'))
|
|
928
|
+
.query_param(new_parameter(currency, key: 'currency'))
|
|
929
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
930
|
+
.auth(Single.new('APIKeyAuth')))
|
|
931
|
+
.response(new_response_handler
|
|
932
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
933
|
+
.deserialize_into(CustomerCosts.method(:from_hash))
|
|
934
|
+
.is_api_response(true)
|
|
935
|
+
.local_error('400',
|
|
936
|
+
'Bad Request',
|
|
937
|
+
APIException)
|
|
938
|
+
.local_error('401',
|
|
939
|
+
'Unauthorized',
|
|
940
|
+
AuthorizationErrorException)
|
|
941
|
+
.local_error('404',
|
|
942
|
+
'Not Found',
|
|
943
|
+
APIException)
|
|
944
|
+
.local_error('409',
|
|
945
|
+
'Conflict',
|
|
946
|
+
IdempotencyRequestMismatchException)
|
|
947
|
+
.local_error('413',
|
|
948
|
+
'Content Too Large',
|
|
949
|
+
APIException)
|
|
950
|
+
.local_error('429',
|
|
951
|
+
'Too Many Requests',
|
|
952
|
+
TooManyRequestsException)
|
|
953
|
+
.local_error('500',
|
|
954
|
+
'Internal Server Error',
|
|
955
|
+
ServerErrorException))
|
|
956
|
+
.execute
|
|
957
|
+
end
|
|
958
|
+
|
|
959
|
+
# Creates a portal session for the customer, returning a short-lived URL
|
|
960
|
+
# that provides
|
|
961
|
+
# authenticated access to the customer's billing portal. The session expires
|
|
962
|
+
# after
|
|
963
|
+
# `expires_in_minutes` (default 60, max 180). By default, creating a new
|
|
964
|
+
# session invalidates
|
|
965
|
+
# any other active portal sessions for the customer; pass
|
|
966
|
+
# `invalidate_existing=false` to
|
|
967
|
+
# allow concurrent sessions.
|
|
968
|
+
# @param [String] customer_id Required parameter: TODO: type description
|
|
969
|
+
# here
|
|
970
|
+
# @param [NewPortalSession] body Required parameter: TODO: type description
|
|
971
|
+
# here
|
|
972
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
973
|
+
def create_customer_portal_session(customer_id: nil,
|
|
974
|
+
body)
|
|
975
|
+
@api_call
|
|
976
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
977
|
+
'/customers/{customer_id}/portal_sessions',
|
|
978
|
+
Server::DEFAULT)
|
|
979
|
+
.template_param(new_parameter(customer_id, key: 'customer_id')
|
|
980
|
+
.should_encode(true))
|
|
981
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
982
|
+
.body_param(new_parameter(body)
|
|
983
|
+
.is_required(true))
|
|
984
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
985
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
986
|
+
.auth(Single.new('APIKeyAuth')))
|
|
987
|
+
.response(new_response_handler
|
|
988
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
989
|
+
.deserialize_into(PortalSession.method(:from_hash))
|
|
990
|
+
.is_api_response(true)
|
|
991
|
+
.local_error('400',
|
|
992
|
+
'Bad Request',
|
|
993
|
+
APIException)
|
|
994
|
+
.local_error('401',
|
|
995
|
+
'Unauthorized',
|
|
996
|
+
AuthorizationErrorException)
|
|
997
|
+
.local_error('404',
|
|
998
|
+
'Not Found',
|
|
999
|
+
APIException)
|
|
1000
|
+
.local_error('409',
|
|
1001
|
+
'Conflict',
|
|
1002
|
+
IdempotencyRequestMismatchException)
|
|
1003
|
+
.local_error('413',
|
|
1004
|
+
'Content Too Large',
|
|
1005
|
+
APIException)
|
|
1006
|
+
.local_error('429',
|
|
1007
|
+
'Too Many Requests',
|
|
1008
|
+
TooManyRequestsException)
|
|
1009
|
+
.local_error('500',
|
|
1010
|
+
'Internal Server Error',
|
|
1011
|
+
ServerErrorException))
|
|
1012
|
+
.execute
|
|
1013
|
+
end
|
|
1014
|
+
|
|
1015
|
+
# Sync Orb's payment methods for the customer with their gateway.
|
|
1016
|
+
# This method can be called before taking an action that may cause the
|
|
1017
|
+
# customer to be charged, ensuring that the most up-to-date
|
|
1018
|
+
# payment method is charged.
|
|
1019
|
+
# **Note**: This functionality is currently only available for Stripe.
|
|
1020
|
+
# @param [String] customer_id Required parameter: TODO: type description
|
|
1021
|
+
# here
|
|
1022
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
1023
|
+
def sync_customer_payment_methods_from_gateway(customer_id: nil)
|
|
1024
|
+
@api_call
|
|
1025
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
1026
|
+
'/customers/{customer_id}/sync_payment_methods_from_gateway',
|
|
1027
|
+
Server::DEFAULT)
|
|
1028
|
+
.template_param(new_parameter(customer_id, key: 'customer_id')
|
|
1029
|
+
.should_encode(true))
|
|
1030
|
+
.auth(Single.new('APIKeyAuth')))
|
|
1031
|
+
.response(new_response_handler
|
|
1032
|
+
.is_response_void(true)
|
|
1033
|
+
.is_api_response(true)
|
|
1034
|
+
.local_error('400',
|
|
1035
|
+
'Bad Request',
|
|
1036
|
+
APIException)
|
|
1037
|
+
.local_error('401',
|
|
1038
|
+
'Unauthorized',
|
|
1039
|
+
AuthorizationErrorException)
|
|
1040
|
+
.local_error('404',
|
|
1041
|
+
'Not Found',
|
|
1042
|
+
APIException)
|
|
1043
|
+
.local_error('409',
|
|
1044
|
+
'Conflict',
|
|
1045
|
+
IdempotencyRequestMismatchException)
|
|
1046
|
+
.local_error('413',
|
|
1047
|
+
'Content Too Large',
|
|
1048
|
+
APIException)
|
|
1049
|
+
.local_error('429',
|
|
1050
|
+
'Too Many Requests',
|
|
1051
|
+
TooManyRequestsException)
|
|
1052
|
+
.local_error('500',
|
|
1053
|
+
'Internal Server Error',
|
|
1054
|
+
ServerErrorException))
|
|
1055
|
+
.execute
|
|
1056
|
+
end
|
|
1057
|
+
end
|
|
1058
|
+
end
|