orb-billing 0.1.3 → 0.3.0
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 +4 -4
- data/.ignore +2 -0
- data/CHANGELOG.md +65 -0
- data/README.md +61 -51
- data/lib/orb/client.rb +7 -6
- data/lib/orb/file_part.rb +55 -0
- data/lib/orb/internal/page.rb +37 -39
- data/lib/orb/internal/transport/base_client.rb +21 -11
- data/lib/orb/internal/transport/pooled_net_requester.rb +3 -3
- data/lib/orb/internal/type/array_of.rb +28 -2
- data/lib/orb/internal/type/base_model.rb +83 -21
- data/lib/orb/internal/type/base_page.rb +10 -1
- data/lib/orb/internal/type/boolean.rb +6 -0
- data/lib/orb/internal/type/converter.rb +28 -1
- data/lib/orb/internal/type/enum.rb +28 -8
- data/lib/orb/internal/type/{io_like.rb → file_input.rb} +35 -15
- data/lib/orb/internal/type/hash_of.rb +28 -2
- data/lib/orb/internal/type/request_parameters.rb +1 -2
- data/lib/orb/internal/type/union.rb +27 -4
- data/lib/orb/internal/type/unknown.rb +6 -0
- data/lib/orb/internal/util.rb +105 -70
- data/lib/orb/internal.rb +5 -2
- data/lib/orb/models/alert.rb +68 -71
- data/lib/orb/models/alert_create_for_customer_params.rb +20 -25
- data/lib/orb/models/alert_create_for_external_customer_params.rb +20 -25
- data/lib/orb/models/alert_create_for_subscription_params.rb +20 -25
- data/lib/orb/models/alert_disable_params.rb +5 -9
- data/lib/orb/models/alert_enable_params.rb +5 -9
- data/lib/orb/models/alert_list_params.rb +26 -36
- data/lib/orb/models/alert_retrieve_params.rb +3 -8
- data/lib/orb/models/alert_update_params.rb +14 -18
- data/lib/orb/models/amount_discount.rb +14 -14
- data/lib/orb/models/billable_metric.rb +23 -20
- data/lib/orb/models/billing_cycle_relative_date.rb +2 -5
- data/lib/orb/models/coupon.rb +28 -21
- data/lib/orb/models/coupon_archive_params.rb +3 -8
- data/lib/orb/models/coupon_create_params.rb +24 -29
- data/lib/orb/models/coupon_fetch_params.rb +3 -8
- data/lib/orb/models/coupon_list_params.rb +17 -17
- data/lib/orb/models/coupons/subscription_list_params.rb +12 -15
- data/lib/orb/models/credit_note.rb +100 -166
- data/lib/orb/models/credit_note_create_params.rb +15 -23
- data/lib/orb/models/credit_note_fetch_params.rb +3 -8
- data/lib/orb/models/credit_note_list_params.rb +20 -30
- data/lib/orb/models/customer.rb +224 -271
- data/lib/orb/models/customer_create_params.rb +211 -252
- data/lib/orb/models/customer_delete_params.rb +3 -8
- data/lib/orb/models/customer_fetch_by_external_id_params.rb +3 -8
- data/lib/orb/models/customer_fetch_params.rb +3 -8
- data/lib/orb/models/customer_list_params.rb +20 -30
- data/lib/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rb +3 -8
- data/lib/orb/models/customer_sync_payment_methods_from_gateway_params.rb +3 -8
- data/lib/orb/models/customer_update_by_external_id_params.rb +207 -250
- data/lib/orb/models/customer_update_params.rb +207 -250
- data/lib/orb/models/customers/balance_transaction_create_params.rb +11 -16
- data/lib/orb/models/customers/balance_transaction_create_response.rb +33 -51
- data/lib/orb/models/customers/balance_transaction_list_params.rb +20 -30
- data/lib/orb/models/customers/balance_transaction_list_response.rb +33 -51
- data/lib/orb/models/customers/cost_list_by_external_id_params.rb +17 -17
- data/lib/orb/models/customers/cost_list_by_external_id_response.rb +22 -26
- data/lib/orb/models/customers/cost_list_params.rb +17 -17
- data/lib/orb/models/customers/cost_list_response.rb +22 -26
- data/lib/orb/models/customers/credit_list_by_external_id_params.rb +18 -22
- data/lib/orb/models/customers/credit_list_by_external_id_response.rb +10 -17
- data/lib/orb/models/customers/credit_list_params.rb +18 -22
- data/lib/orb/models/customers/credit_list_response.rb +10 -17
- data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rb +64 -66
- data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rb +300 -406
- data/lib/orb/models/customers/credits/ledger_create_entry_params.rb +63 -66
- data/lib/orb/models/customers/credits/ledger_create_entry_response.rb +300 -406
- data/lib/orb/models/customers/credits/ledger_list_by_external_id_params.rb +33 -48
- data/lib/orb/models/customers/credits/ledger_list_by_external_id_response.rb +300 -406
- data/lib/orb/models/customers/credits/ledger_list_params.rb +32 -48
- data/lib/orb/models/customers/credits/ledger_list_response.rb +300 -406
- data/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rb +47 -50
- data/lib/orb/models/customers/credits/top_up_create_by_external_id_response.rb +43 -46
- data/lib/orb/models/customers/credits/top_up_create_params.rb +46 -50
- data/lib/orb/models/customers/credits/top_up_create_response.rb +42 -46
- data/lib/orb/models/customers/credits/top_up_delete_by_external_id_params.rb +4 -9
- data/lib/orb/models/customers/credits/top_up_delete_params.rb +4 -9
- data/lib/orb/models/customers/credits/top_up_list_by_external_id_params.rb +12 -15
- data/lib/orb/models/customers/credits/top_up_list_by_external_id_response.rb +43 -46
- data/lib/orb/models/customers/credits/top_up_list_params.rb +12 -15
- data/lib/orb/models/customers/credits/top_up_list_response.rb +42 -46
- data/lib/orb/models/dimensional_price_group.rb +21 -15
- data/lib/orb/models/dimensional_price_group_create_params.rb +17 -23
- data/lib/orb/models/dimensional_price_group_list_params.rb +12 -15
- data/lib/orb/models/dimensional_price_group_retrieve_params.rb +3 -8
- data/lib/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rb +3 -8
- data/lib/orb/models/dimensional_price_groups.rb +3 -7
- data/lib/orb/models/discount.rb +2 -3
- data/lib/orb/models/evaluate_price_group.rb +8 -11
- data/lib/orb/models/event_deprecate_params.rb +3 -8
- data/lib/orb/models/event_deprecate_response.rb +2 -6
- data/lib/orb/models/event_ingest_params.rb +33 -27
- data/lib/orb/models/event_ingest_response.rb +23 -24
- data/lib/orb/models/event_search_params.rb +15 -11
- data/lib/orb/models/event_search_response.rb +27 -22
- data/lib/orb/models/event_update_params.rb +19 -13
- data/lib/orb/models/event_update_response.rb +2 -6
- data/lib/orb/models/events/backfill_close_params.rb +3 -8
- data/lib/orb/models/events/backfill_close_response.rb +34 -39
- data/lib/orb/models/events/backfill_create_params.rb +28 -32
- data/lib/orb/models/events/backfill_create_response.rb +34 -39
- data/lib/orb/models/events/backfill_fetch_params.rb +3 -8
- data/lib/orb/models/events/backfill_fetch_response.rb +34 -39
- data/lib/orb/models/events/backfill_list_params.rb +12 -15
- data/lib/orb/models/events/backfill_list_response.rb +34 -39
- data/lib/orb/models/events/backfill_revert_params.rb +3 -8
- data/lib/orb/models/events/backfill_revert_response.rb +34 -39
- data/lib/orb/models/events/event_volumes.rb +11 -17
- data/lib/orb/models/events/volume_list_params.rb +19 -22
- data/lib/orb/models/invoice.rb +589 -637
- data/lib/orb/models/invoice_create_params.rb +52 -61
- data/lib/orb/models/invoice_fetch_params.rb +3 -8
- data/lib/orb/models/invoice_fetch_upcoming_params.rb +4 -9
- data/lib/orb/models/invoice_fetch_upcoming_response.rb +584 -631
- data/lib/orb/models/invoice_issue_params.rb +10 -14
- data/lib/orb/models/invoice_level_discount.rb +2 -3
- data/lib/orb/models/invoice_line_item_create_params.rb +19 -14
- data/lib/orb/models/invoice_line_item_create_response.rb +247 -269
- data/lib/orb/models/invoice_list_params.rb +51 -66
- data/lib/orb/models/invoice_mark_paid_params.rb +9 -11
- data/lib/orb/models/invoice_pay_params.rb +3 -8
- data/lib/orb/models/invoice_update_params.rb +9 -9
- data/lib/orb/models/invoice_void_params.rb +3 -8
- data/lib/orb/models/item.rb +14 -25
- data/lib/orb/models/item_create_params.rb +5 -9
- data/lib/orb/models/item_fetch_params.rb +3 -8
- data/lib/orb/models/item_list_params.rb +12 -15
- data/lib/orb/models/item_update_params.rb +10 -22
- data/lib/orb/models/metric_create_params.rb +17 -13
- data/lib/orb/models/metric_fetch_params.rb +3 -8
- data/lib/orb/models/metric_list_params.rb +20 -30
- data/lib/orb/models/metric_update_params.rb +9 -9
- data/lib/orb/models/pagination_metadata.rb +3 -7
- data/lib/orb/models/percentage_discount.rb +15 -14
- data/lib/orb/models/plan.rb +250 -279
- data/lib/orb/models/plan_create_params.rb +1623 -1984
- data/lib/orb/models/plan_fetch_params.rb +3 -8
- data/lib/orb/models/plan_list_params.rb +25 -42
- data/lib/orb/models/plan_update_params.rb +12 -10
- data/lib/orb/models/plans/external_plan_id_fetch_params.rb +3 -8
- data/lib/orb/models/plans/external_plan_id_update_params.rb +12 -10
- data/lib/orb/models/price.rb +2709 -3820
- data/lib/orb/models/price_create_params.rb +203 -244
- data/lib/orb/models/price_evaluate_params.rb +21 -30
- data/lib/orb/models/price_evaluate_response.rb +2 -6
- data/lib/orb/models/price_fetch_params.rb +3 -8
- data/lib/orb/models/price_list_params.rb +12 -15
- data/lib/orb/models/price_update_params.rb +9 -9
- data/lib/orb/models/prices/external_price_id_fetch_params.rb +3 -8
- data/lib/orb/models/prices/external_price_id_update_params.rb +9 -9
- data/lib/orb/models/subscription.rb +343 -382
- data/lib/orb/models/subscription_cancel_params.rb +16 -16
- data/lib/orb/models/subscription_cancel_response.rb +339 -377
- data/lib/orb/models/subscription_change_apply_params.rb +7 -10
- data/lib/orb/models/subscription_change_apply_response.rb +365 -398
- data/lib/orb/models/subscription_change_cancel_params.rb +3 -8
- data/lib/orb/models/subscription_change_cancel_response.rb +365 -398
- data/lib/orb/models/subscription_change_retrieve_params.rb +3 -8
- data/lib/orb/models/subscription_change_retrieve_response.rb +366 -398
- data/lib/orb/models/subscription_create_params.rb +3771 -4402
- data/lib/orb/models/subscription_create_response.rb +339 -377
- data/lib/orb/models/subscription_fetch_costs_params.rb +17 -17
- data/lib/orb/models/subscription_fetch_costs_response.rb +22 -26
- data/lib/orb/models/subscription_fetch_params.rb +3 -8
- data/lib/orb/models/subscription_fetch_schedule_params.rb +20 -30
- data/lib/orb/models/subscription_fetch_schedule_response.rb +15 -17
- data/lib/orb/models/subscription_fetch_usage_params.rb +32 -43
- data/lib/orb/models/subscription_list_params.rb +28 -41
- data/lib/orb/models/subscription_price_intervals_params.rb +2018 -2472
- data/lib/orb/models/subscription_price_intervals_response.rb +342 -377
- data/lib/orb/models/subscription_schedule_plan_change_params.rb +3764 -4392
- data/lib/orb/models/subscription_schedule_plan_change_response.rb +342 -377
- data/lib/orb/models/subscription_trigger_phase_params.rb +12 -10
- data/lib/orb/models/subscription_trigger_phase_response.rb +341 -377
- data/lib/orb/models/subscription_unschedule_cancellation_params.rb +3 -8
- data/lib/orb/models/subscription_unschedule_cancellation_response.rb +342 -377
- data/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rb +5 -9
- data/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rb +343 -377
- data/lib/orb/models/subscription_unschedule_pending_plan_changes_params.rb +3 -8
- data/lib/orb/models/subscription_unschedule_pending_plan_changes_response.rb +343 -377
- data/lib/orb/models/subscription_update_fixed_fee_quantity_params.rb +22 -33
- data/lib/orb/models/subscription_update_fixed_fee_quantity_response.rb +342 -377
- data/lib/orb/models/subscription_update_params.rb +21 -23
- data/lib/orb/models/subscription_update_trial_params.rb +15 -18
- data/lib/orb/models/subscription_update_trial_response.rb +341 -377
- data/lib/orb/models/subscription_usage.rb +37 -80
- data/lib/orb/models/subscriptions.rb +3 -7
- data/lib/orb/models/top_level_ping_params.rb +3 -8
- data/lib/orb/models/top_level_ping_response.rb +2 -6
- data/lib/orb/models/trial_discount.rb +16 -24
- data/lib/orb/models/usage_discount.rb +15 -14
- data/lib/orb/request_options.rb +3 -4
- data/lib/orb/resources/alerts.rb +48 -17
- data/lib/orb/resources/coupons/subscriptions.rb +9 -2
- data/lib/orb/resources/coupons.rb +25 -7
- data/lib/orb/resources/credit_notes.rb +17 -4
- data/lib/orb/resources/customers/balance_transactions.rb +18 -3
- data/lib/orb/resources/customers/costs.rb +26 -8
- data/lib/orb/resources/customers/credits/ledger.rb +108 -28
- data/lib/orb/resources/customers/credits/top_ups.rb +67 -20
- data/lib/orb/resources/customers/credits.rb +28 -8
- data/lib/orb/resources/customers.rb +135 -36
- data/lib/orb/resources/dimensional_price_groups.rb +19 -4
- data/lib/orb/resources/events/backfills.rb +32 -9
- data/lib/orb/resources/events/volume.rb +14 -4
- data/lib/orb/resources/events.rb +40 -11
- data/lib/orb/resources/invoice_line_items.rb +16 -6
- data/lib/orb/resources/invoices.rb +77 -17
- data/lib/orb/resources/items.rb +10 -3
- data/lib/orb/resources/metrics.rb +33 -8
- data/lib/orb/resources/plans/external_plan_id.rb +10 -2
- data/lib/orb/resources/plans.rb +47 -11
- data/lib/orb/resources/prices/external_price_id.rb +7 -1
- data/lib/orb/resources/prices.rb +97 -22
- data/lib/orb/resources/subscription_changes.rb +5 -2
- data/lib/orb/resources/subscriptions.rb +292 -78
- data/lib/orb/version.rb +1 -1
- data/lib/orb.rb +2 -10
- data/rbi/lib/orb/client.rbi +7 -6
- data/rbi/lib/orb/file_part.rbi +34 -0
- data/rbi/lib/orb/internal/page.rbi +1 -0
- data/rbi/lib/orb/internal/transport/base_client.rbi +18 -3
- data/rbi/lib/orb/internal/type/array_of.rbi +15 -9
- data/rbi/lib/orb/internal/type/base_model.rbi +22 -0
- data/rbi/lib/orb/internal/type/base_page.rbi +2 -0
- data/rbi/lib/orb/internal/type/boolean.rbi +4 -5
- data/rbi/lib/orb/internal/type/converter.rbi +8 -0
- data/rbi/lib/orb/internal/type/enum.rbi +7 -6
- data/rbi/lib/orb/internal/type/{io_like.rbi → file_input.rbi} +9 -7
- data/rbi/lib/orb/internal/type/hash_of.rbi +15 -9
- data/rbi/lib/orb/internal/type/union.rbi +7 -0
- data/rbi/lib/orb/internal/type/unknown.rbi +4 -5
- data/rbi/lib/orb/internal/util.rbi +39 -19
- data/rbi/lib/orb/internal.rbi +1 -2
- data/rbi/lib/orb/models/alert.rbi +28 -8
- data/rbi/lib/orb/models/alert_create_for_customer_params.rbi +16 -6
- data/rbi/lib/orb/models/alert_create_for_external_customer_params.rbi +16 -6
- data/rbi/lib/orb/models/alert_create_for_subscription_params.rbi +16 -6
- data/rbi/lib/orb/models/alert_disable_params.rbi +5 -2
- data/rbi/lib/orb/models/alert_enable_params.rbi +5 -2
- data/rbi/lib/orb/models/alert_list_params.rbi +6 -0
- data/rbi/lib/orb/models/alert_update_params.rbi +11 -4
- data/rbi/lib/orb/models/amount_discount.rbi +10 -4
- data/rbi/lib/orb/models/billable_metric.rbi +16 -3
- data/rbi/lib/orb/models/billing_cycle_relative_date.rbi +1 -1
- data/rbi/lib/orb/models/coupon.rbi +10 -3
- data/rbi/lib/orb/models/coupon_create_params.rbi +6 -3
- data/rbi/lib/orb/models/coupon_list_params.rbi +13 -3
- data/rbi/lib/orb/models/coupons/subscription_list_params.rbi +8 -2
- data/rbi/lib/orb/models/credit_note.rbi +44 -12
- data/rbi/lib/orb/models/credit_note_create_params.rbi +15 -6
- data/rbi/lib/orb/models/credit_note_list_params.rbi +3 -0
- data/rbi/lib/orb/models/customer.rbi +130 -11
- data/rbi/lib/orb/models/customer_create_params.rbi +142 -8
- data/rbi/lib/orb/models/customer_list_params.rbi +3 -0
- data/rbi/lib/orb/models/customer_update_by_external_id_params.rbi +140 -8
- data/rbi/lib/orb/models/customer_update_params.rbi +140 -8
- data/rbi/lib/orb/models/customers/balance_transaction_create_params.rbi +8 -4
- data/rbi/lib/orb/models/customers/balance_transaction_create_response.rbi +18 -8
- data/rbi/lib/orb/models/customers/balance_transaction_list_params.rbi +3 -0
- data/rbi/lib/orb/models/customers/balance_transaction_list_response.rbi +18 -8
- data/rbi/lib/orb/models/customers/cost_list_by_external_id_params.rbi +9 -5
- data/rbi/lib/orb/models/customers/cost_list_by_external_id_response.rbi +21 -4
- data/rbi/lib/orb/models/customers/cost_list_params.rbi +9 -5
- data/rbi/lib/orb/models/customers/cost_list_response.rbi +21 -4
- data/rbi/lib/orb/models/customers/credit_list_by_external_id_params.rbi +13 -3
- data/rbi/lib/orb/models/customers/credit_list_by_external_id_response.rbi +1 -2
- data/rbi/lib/orb/models/customers/credit_list_params.rbi +13 -3
- data/rbi/lib/orb/models/customers/credit_list_response.rbi +1 -2
- data/rbi/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbi +40 -18
- data/rbi/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rbi +35 -56
- data/rbi/lib/orb/models/customers/credits/ledger_create_entry_params.rbi +40 -6
- data/rbi/lib/orb/models/customers/credits/ledger_create_entry_response.rbi +35 -56
- data/rbi/lib/orb/models/customers/credits/ledger_list_by_external_id_params.rbi +6 -16
- data/rbi/lib/orb/models/customers/credits/ledger_list_by_external_id_response.rbi +35 -56
- data/rbi/lib/orb/models/customers/credits/ledger_list_params.rbi +6 -4
- data/rbi/lib/orb/models/customers/credits/ledger_list_response.rbi +35 -56
- data/rbi/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rbi +27 -10
- data/rbi/lib/orb/models/customers/credits/top_up_create_by_external_id_response.rbi +25 -10
- data/rbi/lib/orb/models/customers/credits/top_up_create_params.rbi +27 -4
- data/rbi/lib/orb/models/customers/credits/top_up_create_response.rbi +25 -10
- data/rbi/lib/orb/models/customers/credits/top_up_list_by_external_id_params.rbi +8 -2
- data/rbi/lib/orb/models/customers/credits/top_up_list_by_external_id_response.rbi +25 -10
- data/rbi/lib/orb/models/customers/credits/top_up_list_params.rbi +8 -2
- data/rbi/lib/orb/models/customers/credits/top_up_list_response.rbi +25 -4
- data/rbi/lib/orb/models/dimensional_price_group.rbi +11 -3
- data/rbi/lib/orb/models/dimensional_price_group_create_params.rbi +4 -0
- data/rbi/lib/orb/models/dimensional_price_group_list_params.rbi +8 -2
- data/rbi/lib/orb/models/evaluate_price_group.rbi +8 -2
- data/rbi/lib/orb/models/event_deprecate_response.rbi +4 -2
- data/rbi/lib/orb/models/event_ingest_params.rbi +22 -5
- data/rbi/lib/orb/models/event_ingest_response.rbi +15 -4
- data/rbi/lib/orb/models/event_search_params.rbi +14 -2
- data/rbi/lib/orb/models/event_search_response.rbi +14 -3
- data/rbi/lib/orb/models/event_update_params.rbi +10 -3
- data/rbi/lib/orb/models/event_update_response.rbi +4 -2
- data/rbi/lib/orb/models/events/backfill_close_response.rbi +14 -2
- data/rbi/lib/orb/models/events/backfill_create_params.rbi +18 -0
- data/rbi/lib/orb/models/events/backfill_create_response.rbi +14 -2
- data/rbi/lib/orb/models/events/backfill_fetch_response.rbi +14 -2
- data/rbi/lib/orb/models/events/backfill_list_params.rbi +8 -2
- data/rbi/lib/orb/models/events/backfill_list_response.rbi +14 -2
- data/rbi/lib/orb/models/events/backfill_revert_response.rbi +14 -2
- data/rbi/lib/orb/models/events/event_volumes.rbi +6 -2
- data/rbi/lib/orb/models/events/volume_list_params.rbi +18 -2
- data/rbi/lib/orb/models/invoice.rbi +375 -46
- data/rbi/lib/orb/models/invoice_create_params.rbi +38 -6
- data/rbi/lib/orb/models/invoice_fetch_upcoming_response.rbi +375 -66
- data/rbi/lib/orb/models/invoice_issue_params.rbi +9 -2
- data/rbi/lib/orb/models/invoice_line_item_create_params.rbi +16 -2
- data/rbi/lib/orb/models/invoice_line_item_create_response.rbi +141 -20
- data/rbi/lib/orb/models/invoice_list_params.rbi +9 -2
- data/rbi/lib/orb/models/invoice_mark_paid_params.rbi +9 -2
- data/rbi/lib/orb/models/invoice_update_params.rbi +7 -2
- data/rbi/lib/orb/models/item.rbi +1 -2
- data/rbi/lib/orb/models/item_create_params.rbi +5 -2
- data/rbi/lib/orb/models/item_list_params.rbi +8 -2
- data/rbi/lib/orb/models/item_update_params.rbi +1 -8
- data/rbi/lib/orb/models/metric_create_params.rbi +15 -2
- data/rbi/lib/orb/models/metric_list_params.rbi +3 -0
- data/rbi/lib/orb/models/metric_update_params.rbi +7 -2
- data/rbi/lib/orb/models/percentage_discount.rbi +11 -4
- data/rbi/lib/orb/models/plan.rbi +102 -15
- data/rbi/lib/orb/models/plan_create_params.rbi +997 -679
- data/rbi/lib/orb/models/plan_list_params.rbi +5 -1
- data/rbi/lib/orb/models/plan_update_params.rbi +11 -2
- data/rbi/lib/orb/models/plans/external_plan_id_update_params.rbi +11 -2
- data/rbi/lib/orb/models/price.rbi +717 -688
- data/rbi/lib/orb/models/price_create_params.rbi +137 -53
- data/rbi/lib/orb/models/price_evaluate_params.rbi +10 -0
- data/rbi/lib/orb/models/price_list_params.rbi +8 -2
- data/rbi/lib/orb/models/price_update_params.rbi +7 -2
- data/rbi/lib/orb/models/prices/external_price_id_update_params.rbi +7 -2
- data/rbi/lib/orb/models/subscription.rbi +174 -11
- data/rbi/lib/orb/models/subscription_cancel_params.rbi +8 -5
- data/rbi/lib/orb/models/subscription_cancel_response.rbi +187 -14
- data/rbi/lib/orb/models/subscription_change_apply_params.rbi +7 -2
- data/rbi/lib/orb/models/subscription_change_apply_response.rbi +199 -18
- data/rbi/lib/orb/models/subscription_change_cancel_response.rbi +199 -18
- data/rbi/lib/orb/models/subscription_change_retrieve_response.rbi +199 -18
- data/rbi/lib/orb/models/subscription_create_params.rbi +2282 -1536
- data/rbi/lib/orb/models/subscription_create_response.rbi +187 -14
- data/rbi/lib/orb/models/subscription_fetch_costs_params.rbi +9 -5
- data/rbi/lib/orb/models/subscription_fetch_costs_response.rbi +21 -4
- data/rbi/lib/orb/models/subscription_fetch_schedule_params.rbi +3 -0
- data/rbi/lib/orb/models/subscription_fetch_schedule_response.rbi +8 -2
- data/rbi/lib/orb/models/subscription_fetch_usage_params.rbi +13 -4
- data/rbi/lib/orb/models/subscription_list_params.rbi +4 -2
- data/rbi/lib/orb/models/subscription_price_intervals_params.rbi +1228 -861
- data/rbi/lib/orb/models/subscription_price_intervals_response.rbi +187 -14
- data/rbi/lib/orb/models/subscription_schedule_plan_change_params.rbi +2288 -1544
- data/rbi/lib/orb/models/subscription_schedule_plan_change_response.rbi +187 -14
- data/rbi/lib/orb/models/subscription_trigger_phase_params.rbi +10 -2
- data/rbi/lib/orb/models/subscription_trigger_phase_response.rbi +187 -14
- data/rbi/lib/orb/models/subscription_unschedule_cancellation_response.rbi +187 -14
- data/rbi/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rbi +5 -2
- data/rbi/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbi +187 -20
- data/rbi/lib/orb/models/subscription_unschedule_pending_plan_changes_response.rbi +187 -14
- data/rbi/lib/orb/models/subscription_update_fixed_fee_quantity_params.rbi +11 -2
- data/rbi/lib/orb/models/subscription_update_fixed_fee_quantity_response.rbi +187 -14
- data/rbi/lib/orb/models/subscription_update_params.rbi +15 -0
- data/rbi/lib/orb/models/subscription_update_trial_params.rbi +11 -5
- data/rbi/lib/orb/models/subscription_update_trial_response.rbi +187 -14
- data/rbi/lib/orb/models/subscription_usage.rbi +2 -16
- data/rbi/lib/orb/models/trial_discount.rbi +5 -1
- data/rbi/lib/orb/models/usage_discount.rbi +11 -3
- data/sig/orb/file_part.rbs +21 -0
- data/sig/orb/internal/transport/base_client.rbs +9 -3
- data/sig/orb/internal/type/array_of.rbs +4 -0
- data/sig/orb/internal/type/base_model.rbs +12 -0
- data/sig/orb/internal/type/converter.rbs +4 -0
- data/sig/orb/internal/type/enum.rbs +4 -2
- data/sig/orb/internal/type/{io_like.rbs → file_input.rbs} +1 -1
- data/sig/orb/internal/type/hash_of.rbs +4 -0
- data/sig/orb/internal/type/union.rbs +4 -0
- data/sig/orb/internal/util.rbs +16 -12
- data/sig/orb/internal.rbs +1 -1
- metadata +9 -5
@@ -3,6 +3,9 @@
|
|
3
3
|
module Orb
|
4
4
|
module Resources
|
5
5
|
class Subscriptions
|
6
|
+
# Some parameter documentations has been truncated, see
|
7
|
+
# {Orb::Models::SubscriptionCreateParams} for more details.
|
8
|
+
#
|
6
9
|
# A subscription represents the purchase of a plan by a customer. The customer is
|
7
10
|
# identified by either the `customer_id` or the `external_customer_id`, and
|
8
11
|
# exactly one of these fields must be provided.
|
@@ -262,37 +265,86 @@ module Orb
|
|
262
265
|
#
|
263
266
|
# @overload create(add_adjustments: nil, add_prices: nil, align_billing_with_subscription_start_date: nil, auto_collection: nil, aws_region: nil, billing_cycle_anchor_configuration: nil, coupon_redemption_code: nil, credits_overage_rate: nil, customer_id: nil, default_invoice_memo: nil, end_date: nil, external_customer_id: nil, external_marketplace: nil, external_marketplace_reporting_id: nil, external_plan_id: nil, filter: nil, initial_phase_order: nil, invoicing_threshold: nil, metadata: nil, net_terms: nil, per_credit_overage_amount: nil, plan_id: nil, plan_version_number: nil, price_overrides: nil, remove_adjustments: nil, remove_prices: nil, replace_adjustments: nil, replace_prices: nil, start_date: nil, trial_duration_days: nil, usage_customer_ids: nil, request_options: {})
|
264
267
|
#
|
265
|
-
# @param add_adjustments [Array<Orb::Models::SubscriptionCreateParams::AddAdjustment>, nil]
|
266
|
-
#
|
268
|
+
# @param add_adjustments [Array<Orb::Models::SubscriptionCreateParams::AddAdjustment>, nil] Additional adjustments to be added to the subscription. (Only available for acco
|
269
|
+
# ...
|
270
|
+
#
|
271
|
+
# @param add_prices [Array<Orb::Models::SubscriptionCreateParams::AddPrice>, nil] Additional prices to be added to the subscription. (Only available for accounts
|
272
|
+
# ...
|
273
|
+
#
|
267
274
|
# @param align_billing_with_subscription_start_date [Boolean]
|
268
|
-
#
|
275
|
+
#
|
276
|
+
# @param auto_collection [Boolean, nil] Determines whether issued invoices for this subscription will automatically be c
|
277
|
+
# ...
|
278
|
+
#
|
269
279
|
# @param aws_region [String, nil]
|
280
|
+
#
|
270
281
|
# @param billing_cycle_anchor_configuration [Orb::Models::SubscriptionCreateParams::BillingCycleAnchorConfiguration, nil]
|
271
|
-
#
|
282
|
+
#
|
283
|
+
# @param coupon_redemption_code [String, nil] Redemption code to be used for this subscription. If the coupon cannot be found
|
284
|
+
# ...
|
285
|
+
#
|
272
286
|
# @param credits_overage_rate [Float, nil]
|
287
|
+
#
|
273
288
|
# @param customer_id [String, nil]
|
274
|
-
#
|
289
|
+
#
|
290
|
+
# @param default_invoice_memo [String, nil] Determines the default memo on this subscription's invoices. Note that if this i
|
291
|
+
# ...
|
292
|
+
#
|
275
293
|
# @param end_date [Time, nil]
|
294
|
+
#
|
276
295
|
# @param external_customer_id [String, nil]
|
296
|
+
#
|
277
297
|
# @param external_marketplace [Symbol, Orb::Models::SubscriptionCreateParams::ExternalMarketplace, nil]
|
298
|
+
#
|
278
299
|
# @param external_marketplace_reporting_id [String, nil]
|
279
|
-
#
|
280
|
-
# @param
|
281
|
-
#
|
282
|
-
#
|
283
|
-
# @param
|
284
|
-
#
|
300
|
+
#
|
301
|
+
# @param external_plan_id [String, nil] The external_plan_id of the plan that the given subscription should be switched
|
302
|
+
# ...
|
303
|
+
#
|
304
|
+
# @param filter [String, nil] An additional filter to apply to usage queries. This filter must be expressed as
|
305
|
+
# ...
|
306
|
+
#
|
307
|
+
# @param initial_phase_order [Integer, nil] The phase of the plan to start with
|
308
|
+
#
|
309
|
+
# @param invoicing_threshold [String, nil] When this subscription's accrued usage reaches this threshold, an invoice will b
|
310
|
+
# ...
|
311
|
+
#
|
312
|
+
# @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed
|
313
|
+
# ...
|
314
|
+
#
|
315
|
+
# @param net_terms [Integer, nil] The net terms determines the difference between the invoice date and the issue d
|
316
|
+
# ...
|
317
|
+
#
|
285
318
|
# @param per_credit_overage_amount [Float, nil]
|
286
|
-
#
|
287
|
-
# @param
|
288
|
-
#
|
289
|
-
#
|
290
|
-
# @param
|
291
|
-
#
|
292
|
-
#
|
319
|
+
#
|
320
|
+
# @param plan_id [String, nil] The plan that the given subscription should be switched to. Note that either thi
|
321
|
+
# ...
|
322
|
+
#
|
323
|
+
# @param plan_version_number [Integer, nil] Specifies which version of the plan to subscribe to. If null, the default versio
|
324
|
+
# ...
|
325
|
+
#
|
326
|
+
# @param price_overrides [Array<Object>, nil] Optionally provide a list of overrides for prices on the plan
|
327
|
+
#
|
328
|
+
# @param remove_adjustments [Array<Orb::Models::SubscriptionCreateParams::RemoveAdjustment>, nil] Plan adjustments to be removed from the subscription. (Only available for accoun
|
329
|
+
# ...
|
330
|
+
#
|
331
|
+
# @param remove_prices [Array<Orb::Models::SubscriptionCreateParams::RemovePrice>, nil] Plan prices to be removed from the subscription. (Only available for accounts th
|
332
|
+
# ...
|
333
|
+
#
|
334
|
+
# @param replace_adjustments [Array<Orb::Models::SubscriptionCreateParams::ReplaceAdjustment>, nil] Plan adjustments to be replaced with additional adjustments on the subscription.
|
335
|
+
# ...
|
336
|
+
#
|
337
|
+
# @param replace_prices [Array<Orb::Models::SubscriptionCreateParams::ReplacePrice>, nil] Plan prices to be replaced with additional prices on the subscription. (Only ava
|
338
|
+
# ...
|
339
|
+
#
|
293
340
|
# @param start_date [Time, nil]
|
294
|
-
#
|
295
|
-
# @param
|
341
|
+
#
|
342
|
+
# @param trial_duration_days [Integer, nil] The duration of the trial period in days. If not provided, this defaults to the
|
343
|
+
# ...
|
344
|
+
#
|
345
|
+
# @param usage_customer_ids [Array<String>, nil] A list of customer IDs whose usage events will be aggregated and billed under th
|
346
|
+
# ...
|
347
|
+
#
|
296
348
|
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
297
349
|
#
|
298
350
|
# @return [Orb::Models::SubscriptionCreateResponse]
|
@@ -309,6 +361,9 @@ module Orb
|
|
309
361
|
)
|
310
362
|
end
|
311
363
|
|
364
|
+
# Some parameter documentations has been truncated, see
|
365
|
+
# {Orb::Models::SubscriptionUpdateParams} for more details.
|
366
|
+
#
|
312
367
|
# This endpoint can be used to update the `metadata`, `net terms`,
|
313
368
|
# `auto_collection`, `invoicing_threshold`, and `default_invoice_memo` properties
|
314
369
|
# on a subscription.
|
@@ -316,11 +371,22 @@ module Orb
|
|
316
371
|
# @overload update(subscription_id, auto_collection: nil, default_invoice_memo: nil, invoicing_threshold: nil, metadata: nil, net_terms: nil, request_options: {})
|
317
372
|
#
|
318
373
|
# @param subscription_id [String]
|
319
|
-
#
|
320
|
-
# @param
|
321
|
-
#
|
322
|
-
#
|
323
|
-
# @param
|
374
|
+
#
|
375
|
+
# @param auto_collection [Boolean, nil] Determines whether issued invoices for this subscription will automatically be c
|
376
|
+
# ...
|
377
|
+
#
|
378
|
+
# @param default_invoice_memo [String, nil] Determines the default memo on this subscription's invoices. Note that if this i
|
379
|
+
# ...
|
380
|
+
#
|
381
|
+
# @param invoicing_threshold [String, nil] When this subscription's accrued usage reaches this threshold, an invoice will b
|
382
|
+
# ...
|
383
|
+
#
|
384
|
+
# @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed
|
385
|
+
# ...
|
386
|
+
#
|
387
|
+
# @param net_terms [Integer, nil] Determines the difference between the invoice issue date for subscription invoic
|
388
|
+
# ...
|
389
|
+
#
|
324
390
|
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
325
391
|
#
|
326
392
|
# @return [Orb::Models::Subscription]
|
@@ -337,6 +403,9 @@ module Orb
|
|
337
403
|
)
|
338
404
|
end
|
339
405
|
|
406
|
+
# Some parameter documentations has been truncated, see
|
407
|
+
# {Orb::Models::SubscriptionListParams} for more details.
|
408
|
+
#
|
340
409
|
# This endpoint returns a list of all subscriptions for an account as a
|
341
410
|
# [paginated](/api-reference/pagination) list, ordered starting from the most
|
342
411
|
# recently created subscription. For a full discussion of the subscription
|
@@ -350,14 +419,24 @@ module Orb
|
|
350
419
|
# @overload list(created_at_gt: nil, created_at_gte: nil, created_at_lt: nil, created_at_lte: nil, cursor: nil, customer_id: nil, external_customer_id: nil, limit: nil, status: nil, request_options: {})
|
351
420
|
#
|
352
421
|
# @param created_at_gt [Time, nil]
|
422
|
+
#
|
353
423
|
# @param created_at_gte [Time, nil]
|
424
|
+
#
|
354
425
|
# @param created_at_lt [Time, nil]
|
426
|
+
#
|
355
427
|
# @param created_at_lte [Time, nil]
|
356
|
-
#
|
428
|
+
#
|
429
|
+
# @param cursor [String, nil] Cursor for pagination. This can be populated by the `next_cursor` value returned
|
430
|
+
# ...
|
431
|
+
#
|
357
432
|
# @param customer_id [Array<String>, nil]
|
433
|
+
#
|
358
434
|
# @param external_customer_id [Array<String>, nil]
|
359
|
-
#
|
435
|
+
#
|
436
|
+
# @param limit [Integer] The number of items to fetch. Defaults to 20.
|
437
|
+
#
|
360
438
|
# @param status [Symbol, Orb::Models::SubscriptionListParams::Status, nil]
|
439
|
+
#
|
361
440
|
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
362
441
|
#
|
363
442
|
# @return [Orb::Internal::Page<Orb::Models::Subscription>]
|
@@ -380,6 +459,9 @@ module Orb
|
|
380
459
|
)
|
381
460
|
end
|
382
461
|
|
462
|
+
# Some parameter documentations has been truncated, see
|
463
|
+
# {Orb::Models::SubscriptionCancelParams} for more details.
|
464
|
+
#
|
383
465
|
# This endpoint can be used to cancel an existing subscription. It returns the
|
384
466
|
# serialized subscription object with an `end_date` parameter that signifies when
|
385
467
|
# the subscription will transition to an ended state.
|
@@ -445,9 +527,15 @@ module Orb
|
|
445
527
|
# @overload cancel(subscription_id, cancel_option:, allow_invoice_credit_or_void: nil, cancellation_date: nil, request_options: {})
|
446
528
|
#
|
447
529
|
# @param subscription_id [String]
|
448
|
-
#
|
449
|
-
# @param
|
450
|
-
#
|
530
|
+
#
|
531
|
+
# @param cancel_option [Symbol, Orb::Models::SubscriptionCancelParams::CancelOption] Determines the timing of subscription cancellation
|
532
|
+
#
|
533
|
+
# @param allow_invoice_credit_or_void [Boolean, nil] If false, this request will fail if it would void an issued invoice or create a
|
534
|
+
# ...
|
535
|
+
#
|
536
|
+
# @param cancellation_date [Time, nil] The date that the cancellation should take effect. This parameter can only be pa
|
537
|
+
# ...
|
538
|
+
#
|
451
539
|
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
452
540
|
#
|
453
541
|
# @return [Orb::Models::SubscriptionCancelResponse]
|
@@ -484,6 +572,9 @@ module Orb
|
|
484
572
|
)
|
485
573
|
end
|
486
574
|
|
575
|
+
# Some parameter documentations has been truncated, see
|
576
|
+
# {Orb::Models::SubscriptionFetchCostsParams} for more details.
|
577
|
+
#
|
487
578
|
# This endpoint is used to fetch a day-by-day snapshot of a subscription's costs
|
488
579
|
# in Orb, calculated by applying pricing information to the underlying usage (see
|
489
580
|
# the [subscription usage endpoint](fetch-subscription-usage) to fetch usage per
|
@@ -498,10 +589,16 @@ module Orb
|
|
498
589
|
# @overload fetch_costs(subscription_id, currency: nil, timeframe_end: nil, timeframe_start: nil, view_mode: nil, request_options: {})
|
499
590
|
#
|
500
591
|
# @param subscription_id [String]
|
501
|
-
#
|
502
|
-
# @param
|
503
|
-
#
|
504
|
-
# @param
|
592
|
+
#
|
593
|
+
# @param currency [String, nil] The currency or custom pricing unit to use.
|
594
|
+
#
|
595
|
+
# @param timeframe_end [Time, nil] Costs returned are exclusive of `timeframe_end`.
|
596
|
+
#
|
597
|
+
# @param timeframe_start [Time, nil] Costs returned are inclusive of `timeframe_start`.
|
598
|
+
#
|
599
|
+
# @param view_mode [Symbol, Orb::Models::SubscriptionFetchCostsParams::ViewMode, nil] Controls whether Orb returns cumulative costs since the start of the billing per
|
600
|
+
# ...
|
601
|
+
#
|
505
602
|
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
506
603
|
#
|
507
604
|
# @return [Orb::Models::SubscriptionFetchCostsResponse]
|
@@ -518,6 +615,9 @@ module Orb
|
|
518
615
|
)
|
519
616
|
end
|
520
617
|
|
618
|
+
# Some parameter documentations has been truncated, see
|
619
|
+
# {Orb::Models::SubscriptionFetchScheduleParams} for more details.
|
620
|
+
#
|
521
621
|
# This endpoint returns a [paginated](/api-reference/pagination) list of all plans
|
522
622
|
# associated with a subscription along with their start and end dates. This list
|
523
623
|
# contains the subscription's initial plan along with past and future plan
|
@@ -526,12 +626,20 @@ module Orb
|
|
526
626
|
# @overload fetch_schedule(subscription_id, cursor: nil, limit: nil, start_date_gt: nil, start_date_gte: nil, start_date_lt: nil, start_date_lte: nil, request_options: {})
|
527
627
|
#
|
528
628
|
# @param subscription_id [String]
|
529
|
-
#
|
530
|
-
# @param
|
629
|
+
#
|
630
|
+
# @param cursor [String, nil] Cursor for pagination. This can be populated by the `next_cursor` value returned
|
631
|
+
# ...
|
632
|
+
#
|
633
|
+
# @param limit [Integer] The number of items to fetch. Defaults to 20.
|
634
|
+
#
|
531
635
|
# @param start_date_gt [Time, nil]
|
636
|
+
#
|
532
637
|
# @param start_date_gte [Time, nil]
|
638
|
+
#
|
533
639
|
# @param start_date_lt [Time, nil]
|
640
|
+
#
|
534
641
|
# @param start_date_lte [Time, nil]
|
642
|
+
#
|
535
643
|
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
536
644
|
#
|
537
645
|
# @return [Orb::Internal::Page<Orb::Models::SubscriptionFetchScheduleResponse>]
|
@@ -554,6 +662,9 @@ module Orb
|
|
554
662
|
)
|
555
663
|
end
|
556
664
|
|
665
|
+
# Some parameter documentations has been truncated, see
|
666
|
+
# {Orb::Models::SubscriptionFetchUsageParams} for more details.
|
667
|
+
#
|
557
668
|
# This endpoint is used to fetch a subscription's usage in Orb. Especially when
|
558
669
|
# combined with optional query parameters, this endpoint is a powerful way to
|
559
670
|
# build visualizations on top of Orb's event data and metrics.
|
@@ -752,16 +863,29 @@ module Orb
|
|
752
863
|
# @overload fetch_usage(subscription_id, billable_metric_id: nil, first_dimension_key: nil, first_dimension_value: nil, granularity: nil, group_by: nil, second_dimension_key: nil, second_dimension_value: nil, timeframe_end: nil, timeframe_start: nil, view_mode: nil, request_options: {})
|
753
864
|
#
|
754
865
|
# @param subscription_id [String]
|
755
|
-
#
|
866
|
+
#
|
867
|
+
# @param billable_metric_id [String, nil] When specified in conjunction with `group_by`, this parameter filters usage to a
|
868
|
+
# ...
|
869
|
+
#
|
756
870
|
# @param first_dimension_key [String, nil]
|
871
|
+
#
|
757
872
|
# @param first_dimension_value [String, nil]
|
758
|
-
#
|
759
|
-
# @param
|
873
|
+
#
|
874
|
+
# @param granularity [Symbol, Orb::Models::SubscriptionFetchUsageParams::Granularity, nil] This determines the windowing of usage reporting.
|
875
|
+
#
|
876
|
+
# @param group_by [String, nil] Groups per-price usage by the key provided.
|
877
|
+
#
|
760
878
|
# @param second_dimension_key [String, nil]
|
879
|
+
#
|
761
880
|
# @param second_dimension_value [String, nil]
|
762
|
-
#
|
763
|
-
# @param
|
764
|
-
#
|
881
|
+
#
|
882
|
+
# @param timeframe_end [Time, nil] Usage returned is exclusive of `timeframe_end`.
|
883
|
+
#
|
884
|
+
# @param timeframe_start [Time, nil] Usage returned is inclusive of `timeframe_start`.
|
885
|
+
#
|
886
|
+
# @param view_mode [Symbol, Orb::Models::SubscriptionFetchUsageParams::ViewMode, nil] Controls whether Orb returns cumulative usage since the start of the billing per
|
887
|
+
# ...
|
888
|
+
#
|
765
889
|
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
766
890
|
#
|
767
891
|
# @return [Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage, Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage]
|
@@ -778,6 +902,9 @@ module Orb
|
|
778
902
|
)
|
779
903
|
end
|
780
904
|
|
905
|
+
# Some parameter documentations has been truncated, see
|
906
|
+
# {Orb::Models::SubscriptionPriceIntervalsParams} for more details.
|
907
|
+
#
|
781
908
|
# This endpoint is used to add and edit subscription
|
782
909
|
# [price intervals](/api-reference/price-interval/add-or-edit-price-intervals). By
|
783
910
|
# making modifications to a subscription’s price intervals, you can
|
@@ -854,11 +981,18 @@ module Orb
|
|
854
981
|
# @overload price_intervals(subscription_id, add: nil, add_adjustments: nil, allow_invoice_credit_or_void: nil, edit: nil, edit_adjustments: nil, request_options: {})
|
855
982
|
#
|
856
983
|
# @param subscription_id [String]
|
857
|
-
#
|
858
|
-
# @param
|
859
|
-
#
|
860
|
-
# @param
|
861
|
-
#
|
984
|
+
#
|
985
|
+
# @param add [Array<Orb::Models::SubscriptionPriceIntervalsParams::Add>] A list of price intervals to add to the subscription.
|
986
|
+
#
|
987
|
+
# @param add_adjustments [Array<Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment>] A list of adjustments to add to the subscription.
|
988
|
+
#
|
989
|
+
# @param allow_invoice_credit_or_void [Boolean, nil] If false, this request will fail if it would void an issued invoice or create a
|
990
|
+
# ...
|
991
|
+
#
|
992
|
+
# @param edit [Array<Orb::Models::SubscriptionPriceIntervalsParams::Edit>] A list of price intervals to edit on the subscription.
|
993
|
+
#
|
994
|
+
# @param edit_adjustments [Array<Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment>] A list of adjustments to edit on the subscription.
|
995
|
+
#
|
862
996
|
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
863
997
|
#
|
864
998
|
# @return [Orb::Models::SubscriptionPriceIntervalsResponse]
|
@@ -875,6 +1009,9 @@ module Orb
|
|
875
1009
|
)
|
876
1010
|
end
|
877
1011
|
|
1012
|
+
# Some parameter documentations has been truncated, see
|
1013
|
+
# {Orb::Models::SubscriptionSchedulePlanChangeParams} for more details.
|
1014
|
+
#
|
878
1015
|
# This endpoint can be used to change an existing subscription's plan. It returns
|
879
1016
|
# the serialized updated subscription object.
|
880
1017
|
#
|
@@ -1062,32 +1199,79 @@ module Orb
|
|
1062
1199
|
# @overload schedule_plan_change(subscription_id, change_option:, add_adjustments: nil, add_prices: nil, align_billing_with_plan_change_date: nil, auto_collection: nil, billing_cycle_alignment: nil, billing_cycle_anchor_configuration: nil, change_date: nil, coupon_redemption_code: nil, credits_overage_rate: nil, default_invoice_memo: nil, external_plan_id: nil, filter: nil, initial_phase_order: nil, invoicing_threshold: nil, net_terms: nil, per_credit_overage_amount: nil, plan_id: nil, plan_version_number: nil, price_overrides: nil, remove_adjustments: nil, remove_prices: nil, replace_adjustments: nil, replace_prices: nil, trial_duration_days: nil, usage_customer_ids: nil, request_options: {})
|
1063
1200
|
#
|
1064
1201
|
# @param subscription_id [String]
|
1202
|
+
#
|
1065
1203
|
# @param change_option [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ChangeOption]
|
1066
|
-
#
|
1067
|
-
# @param
|
1068
|
-
#
|
1069
|
-
#
|
1070
|
-
# @param
|
1204
|
+
#
|
1205
|
+
# @param add_adjustments [Array<Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment>, nil] Additional adjustments to be added to the subscription. (Only available for acco
|
1206
|
+
# ...
|
1207
|
+
#
|
1208
|
+
# @param add_prices [Array<Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice>, nil] Additional prices to be added to the subscription. (Only available for accounts
|
1209
|
+
# ...
|
1210
|
+
#
|
1211
|
+
# @param align_billing_with_plan_change_date [Boolean, nil] [DEPRECATED] Use billing_cycle_alignment instead. Reset billing periods to be al
|
1212
|
+
# ...
|
1213
|
+
#
|
1214
|
+
# @param auto_collection [Boolean, nil] Determines whether issued invoices for this subscription will automatically be c
|
1215
|
+
# ...
|
1216
|
+
#
|
1217
|
+
# @param billing_cycle_alignment [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::BillingCycleAlignment, nil] Reset billing periods to be aligned with the plan change's effective date or sta
|
1218
|
+
# ...
|
1219
|
+
#
|
1071
1220
|
# @param billing_cycle_anchor_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::BillingCycleAnchorConfiguration, nil]
|
1072
|
-
#
|
1073
|
-
# @param
|
1221
|
+
#
|
1222
|
+
# @param change_date [Time, nil] The date that the plan change should take effect. This parameter can only be pas
|
1223
|
+
# ...
|
1224
|
+
#
|
1225
|
+
# @param coupon_redemption_code [String, nil] Redemption code to be used for this subscription. If the coupon cannot be found
|
1226
|
+
# ...
|
1227
|
+
#
|
1074
1228
|
# @param credits_overage_rate [Float, nil]
|
1075
|
-
#
|
1076
|
-
# @param
|
1077
|
-
#
|
1078
|
-
#
|
1079
|
-
# @param
|
1080
|
-
#
|
1229
|
+
#
|
1230
|
+
# @param default_invoice_memo [String, nil] Determines the default memo on this subscription's invoices. Note that if this i
|
1231
|
+
# ...
|
1232
|
+
#
|
1233
|
+
# @param external_plan_id [String, nil] The external_plan_id of the plan that the given subscription should be switched
|
1234
|
+
# ...
|
1235
|
+
#
|
1236
|
+
# @param filter [String, nil] An additional filter to apply to usage queries. This filter must be expressed as
|
1237
|
+
# ...
|
1238
|
+
#
|
1239
|
+
# @param initial_phase_order [Integer, nil] The phase of the plan to start with
|
1240
|
+
#
|
1241
|
+
# @param invoicing_threshold [String, nil] When this subscription's accrued usage reaches this threshold, an invoice will b
|
1242
|
+
# ...
|
1243
|
+
#
|
1244
|
+
# @param net_terms [Integer, nil] The net terms determines the difference between the invoice date and the issue d
|
1245
|
+
# ...
|
1246
|
+
#
|
1081
1247
|
# @param per_credit_overage_amount [Float, nil]
|
1082
|
-
#
|
1083
|
-
# @param
|
1084
|
-
#
|
1085
|
-
#
|
1086
|
-
# @param
|
1087
|
-
#
|
1088
|
-
#
|
1089
|
-
# @param
|
1090
|
-
#
|
1248
|
+
#
|
1249
|
+
# @param plan_id [String, nil] The plan that the given subscription should be switched to. Note that either thi
|
1250
|
+
# ...
|
1251
|
+
#
|
1252
|
+
# @param plan_version_number [Integer, nil] Specifies which version of the plan to change to. If null, the default version w
|
1253
|
+
# ...
|
1254
|
+
#
|
1255
|
+
# @param price_overrides [Array<Object>, nil] Optionally provide a list of overrides for prices on the plan
|
1256
|
+
#
|
1257
|
+
# @param remove_adjustments [Array<Orb::Models::SubscriptionSchedulePlanChangeParams::RemoveAdjustment>, nil] Plan adjustments to be removed from the subscription. (Only available for accoun
|
1258
|
+
# ...
|
1259
|
+
#
|
1260
|
+
# @param remove_prices [Array<Orb::Models::SubscriptionSchedulePlanChangeParams::RemovePrice>, nil] Plan prices to be removed from the subscription. (Only available for accounts th
|
1261
|
+
# ...
|
1262
|
+
#
|
1263
|
+
# @param replace_adjustments [Array<Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment>, nil] Plan adjustments to be replaced with additional adjustments on the subscription.
|
1264
|
+
# ...
|
1265
|
+
#
|
1266
|
+
# @param replace_prices [Array<Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice>, nil] Plan prices to be replaced with additional prices on the subscription. (Only ava
|
1267
|
+
# ...
|
1268
|
+
#
|
1269
|
+
# @param trial_duration_days [Integer, nil] The duration of the trial period in days. If not provided, this defaults to the
|
1270
|
+
# ...
|
1271
|
+
#
|
1272
|
+
# @param usage_customer_ids [Array<String>, nil] A list of customer IDs whose usage events will be aggregated and billed under th
|
1273
|
+
# ...
|
1274
|
+
#
|
1091
1275
|
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
1092
1276
|
#
|
1093
1277
|
# @return [Orb::Models::SubscriptionSchedulePlanChangeResponse]
|
@@ -1104,14 +1288,22 @@ module Orb
|
|
1104
1288
|
)
|
1105
1289
|
end
|
1106
1290
|
|
1291
|
+
# Some parameter documentations has been truncated, see
|
1292
|
+
# {Orb::Models::SubscriptionTriggerPhaseParams} for more details.
|
1293
|
+
#
|
1107
1294
|
# Manually trigger a phase, effective the given date (or the current time, if not
|
1108
1295
|
# specified).
|
1109
1296
|
#
|
1110
1297
|
# @overload trigger_phase(subscription_id, allow_invoice_credit_or_void: nil, effective_date: nil, request_options: {})
|
1111
1298
|
#
|
1112
1299
|
# @param subscription_id [String]
|
1113
|
-
#
|
1114
|
-
# @param
|
1300
|
+
#
|
1301
|
+
# @param allow_invoice_credit_or_void [Boolean, nil] If false, this request will fail if it would void an issued invoice or create a
|
1302
|
+
# ...
|
1303
|
+
#
|
1304
|
+
# @param effective_date [Date, nil] The date on which the phase change should take effect. If not provided, defaults
|
1305
|
+
# ...
|
1306
|
+
#
|
1115
1307
|
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
1116
1308
|
#
|
1117
1309
|
# @return [Orb::Models::SubscriptionTriggerPhaseResponse]
|
@@ -1161,7 +1353,9 @@ module Orb
|
|
1161
1353
|
# @overload unschedule_fixed_fee_quantity_updates(subscription_id, price_id:, request_options: {})
|
1162
1354
|
#
|
1163
1355
|
# @param subscription_id [String]
|
1164
|
-
#
|
1356
|
+
#
|
1357
|
+
# @param price_id [String] Price for which the updates should be cleared. Must be a fixed fee.
|
1358
|
+
#
|
1165
1359
|
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
1166
1360
|
#
|
1167
1361
|
# @return [Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse]
|
@@ -1198,6 +1392,9 @@ module Orb
|
|
1198
1392
|
)
|
1199
1393
|
end
|
1200
1394
|
|
1395
|
+
# Some parameter documentations has been truncated, see
|
1396
|
+
# {Orb::Models::SubscriptionUpdateFixedFeeQuantityParams} for more details.
|
1397
|
+
#
|
1201
1398
|
# This endpoint can be used to update the quantity for a fixed fee.
|
1202
1399
|
#
|
1203
1400
|
# To be eligible, the subscription must currently be active and the price
|
@@ -1216,11 +1413,20 @@ module Orb
|
|
1216
1413
|
# @overload update_fixed_fee_quantity(subscription_id, price_id:, quantity:, allow_invoice_credit_or_void: nil, change_option: nil, effective_date: nil, request_options: {})
|
1217
1414
|
#
|
1218
1415
|
# @param subscription_id [String]
|
1219
|
-
#
|
1416
|
+
#
|
1417
|
+
# @param price_id [String] Price for which the quantity should be updated. Must be a fixed fee.
|
1418
|
+
#
|
1220
1419
|
# @param quantity [Float]
|
1221
|
-
#
|
1222
|
-
# @param
|
1223
|
-
#
|
1420
|
+
#
|
1421
|
+
# @param allow_invoice_credit_or_void [Boolean, nil] If false, this request will fail if it would void an issued invoice or create a
|
1422
|
+
# ...
|
1423
|
+
#
|
1424
|
+
# @param change_option [Symbol, Orb::Models::SubscriptionUpdateFixedFeeQuantityParams::ChangeOption] Determines when the change takes effect. Note that if `effective_date` is specif
|
1425
|
+
# ...
|
1426
|
+
#
|
1427
|
+
# @param effective_date [Date, nil] The date that the quantity change should take effect, localized to the customer'
|
1428
|
+
# ...
|
1429
|
+
#
|
1224
1430
|
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
1225
1431
|
#
|
1226
1432
|
# @return [Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse]
|
@@ -1237,6 +1443,9 @@ module Orb
|
|
1237
1443
|
)
|
1238
1444
|
end
|
1239
1445
|
|
1446
|
+
# Some parameter documentations has been truncated, see
|
1447
|
+
# {Orb::Models::SubscriptionUpdateTrialParams} for more details.
|
1448
|
+
#
|
1240
1449
|
# This endpoint is used to update the trial end date for a subscription. The new
|
1241
1450
|
# trial end date must be within the time range of the current plan (i.e. the new
|
1242
1451
|
# trial end date must be on or after the subscription's start date on the current
|
@@ -1259,8 +1468,13 @@ module Orb
|
|
1259
1468
|
# @overload update_trial(subscription_id, trial_end_date:, shift: nil, request_options: {})
|
1260
1469
|
#
|
1261
1470
|
# @param subscription_id [String]
|
1262
|
-
#
|
1263
|
-
# @param
|
1471
|
+
#
|
1472
|
+
# @param trial_end_date [Time, Symbol, Orb::Models::SubscriptionUpdateTrialParams::TrialEndDate] The new date that the trial should end, or the literal string `immediate` to end
|
1473
|
+
# ...
|
1474
|
+
#
|
1475
|
+
# @param shift [Boolean] If true, shifts subsequent price and adjustment intervals (preserving their dura
|
1476
|
+
# ...
|
1477
|
+
#
|
1264
1478
|
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
1265
1479
|
#
|
1266
1480
|
# @return [Orb::Models::SubscriptionUpdateTrialResponse]
|
data/lib/orb/version.rb
CHANGED
data/lib/orb.rb
CHANGED
@@ -19,15 +19,6 @@ require "uri"
|
|
19
19
|
# We already ship the preferred sorbet manifests in the package itself.
|
20
20
|
# `tapioca` currently does not offer us a way to opt out of unnecessary compilation.
|
21
21
|
if Object.const_defined?(:Tapioca) && caller.chain([$PROGRAM_NAME]).chain(ARGV).grep(/tapioca/)
|
22
|
-
Warning.warn(
|
23
|
-
<<~WARN
|
24
|
-
\n
|
25
|
-
⚠️ skipped loading of "orb" gem under `tapioca`.
|
26
|
-
|
27
|
-
This message is normal and expected if you are running a `tapioca` command, and does not impact `.rbi` generation.
|
28
|
-
\n
|
29
|
-
WARN
|
30
|
-
)
|
31
22
|
return
|
32
23
|
end
|
33
24
|
|
@@ -40,7 +31,7 @@ require_relative "orb/internal/util"
|
|
40
31
|
require_relative "orb/internal/type/converter"
|
41
32
|
require_relative "orb/internal/type/unknown"
|
42
33
|
require_relative "orb/internal/type/boolean"
|
43
|
-
require_relative "orb/internal/type/
|
34
|
+
require_relative "orb/internal/type/file_input"
|
44
35
|
require_relative "orb/internal/type/enum"
|
45
36
|
require_relative "orb/internal/type/union"
|
46
37
|
require_relative "orb/internal/type/array_of"
|
@@ -50,6 +41,7 @@ require_relative "orb/internal/type/base_page"
|
|
50
41
|
require_relative "orb/internal/type/request_parameters"
|
51
42
|
require_relative "orb/internal"
|
52
43
|
require_relative "orb/request_options"
|
44
|
+
require_relative "orb/file_part"
|
53
45
|
require_relative "orb/errors"
|
54
46
|
require_relative "orb/internal/transport/base_client"
|
55
47
|
require_relative "orb/internal/transport/pooled_net_requester"
|
data/rbi/lib/orb/client.rbi
CHANGED
@@ -78,13 +78,14 @@ module Orb
|
|
78
78
|
def self.new(
|
79
79
|
# Defaults to `ENV["ORB_API_KEY"]`
|
80
80
|
api_key: ENV["ORB_API_KEY"],
|
81
|
-
# Override the default base URL for the API, e.g.,
|
82
|
-
|
81
|
+
# Override the default base URL for the API, e.g.,
|
82
|
+
# `"https://api.example.com/v2/"`. Defaults to `ENV["ORB_BASE_URL"]`
|
83
|
+
base_url: ENV["ORB_BASE_URL"],
|
83
84
|
# Max number of retries to attempt after a failed retryable request.
|
84
|
-
max_retries: DEFAULT_MAX_RETRIES,
|
85
|
-
timeout: DEFAULT_TIMEOUT_IN_SECONDS,
|
86
|
-
initial_retry_delay: DEFAULT_INITIAL_RETRY_DELAY,
|
87
|
-
max_retry_delay: DEFAULT_MAX_RETRY_DELAY,
|
85
|
+
max_retries: Orb::Client::DEFAULT_MAX_RETRIES,
|
86
|
+
timeout: Orb::Client::DEFAULT_TIMEOUT_IN_SECONDS,
|
87
|
+
initial_retry_delay: Orb::Client::DEFAULT_INITIAL_RETRY_DELAY,
|
88
|
+
max_retry_delay: Orb::Client::DEFAULT_MAX_RETRY_DELAY,
|
88
89
|
idempotency_header: "Idempotency-Key"
|
89
90
|
); end
|
90
91
|
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Orb
|
4
|
+
class FilePart
|
5
|
+
sig { returns(T.any(Pathname, StringIO, IO, String)) }
|
6
|
+
attr_reader :content
|
7
|
+
|
8
|
+
sig { returns(T.nilable(String)) }
|
9
|
+
attr_reader :content_type
|
10
|
+
|
11
|
+
sig { returns(T.nilable(String)) }
|
12
|
+
attr_reader :filename
|
13
|
+
|
14
|
+
# @api private
|
15
|
+
sig { returns(String) }
|
16
|
+
private def read; end
|
17
|
+
|
18
|
+
sig { params(a: T.anything).returns(String) }
|
19
|
+
def to_json(*a); end
|
20
|
+
|
21
|
+
sig { params(a: T.anything).returns(String) }
|
22
|
+
def to_yaml(*a); end
|
23
|
+
|
24
|
+
sig do
|
25
|
+
params(
|
26
|
+
content: T.any(Pathname, StringIO, IO, String),
|
27
|
+
filename: T.nilable(String),
|
28
|
+
content_type: T.nilable(String)
|
29
|
+
)
|
30
|
+
.returns(T.attached_class)
|
31
|
+
end
|
32
|
+
def self.new(content, filename: nil, content_type: nil); end
|
33
|
+
end
|
34
|
+
end
|