orb-billing 0.2.0 → 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/CHANGELOG.md +34 -0
- data/README.md +59 -49
- data/lib/orb/client.rb +4 -4
- data/lib/orb/file_part.rb +55 -0
- data/lib/orb/internal/page.rb +4 -8
- data/lib/orb/internal/transport/base_client.rb +7 -7
- data/lib/orb/internal/transport/pooled_net_requester.rb +2 -2
- data/lib/orb/internal/type/array_of.rb +11 -0
- data/lib/orb/internal/type/base_model.rb +32 -14
- data/lib/orb/internal/type/base_page.rb +9 -1
- data/lib/orb/internal/type/boolean.rb +4 -0
- data/lib/orb/internal/type/converter.rb +4 -1
- data/lib/orb/internal/type/enum.rb +9 -5
- data/lib/orb/internal/type/{io_like.rb → file_input.rb} +33 -15
- data/lib/orb/internal/type/hash_of.rb +11 -0
- data/lib/orb/internal/type/request_parameters.rb +1 -2
- data/lib/orb/internal/type/union.rb +10 -1
- data/lib/orb/internal/type/unknown.rb +4 -0
- data/lib/orb/internal/util.rb +69 -61
- data/lib/orb/internal.rb +0 -1
- 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 +4 -4
- data/rbi/lib/orb/file_part.rbi +34 -0
- data/rbi/lib/orb/internal/transport/base_client.rbi +17 -3
- data/rbi/lib/orb/internal/type/array_of.rbi +3 -0
- data/rbi/lib/orb/internal/type/base_model.rbi +7 -1
- data/rbi/lib/orb/internal/type/base_page.rbi +2 -0
- data/rbi/lib/orb/internal/type/enum.rbi +3 -6
- data/rbi/lib/orb/internal/type/{io_like.rbi → file_input.rbi} +5 -2
- data/rbi/lib/orb/internal/type/hash_of.rbi +3 -0
- data/rbi/lib/orb/internal/type/union.rbi +3 -0
- data/rbi/lib/orb/internal/util.rbi +24 -19
- data/rbi/lib/orb/internal.rbi +0 -1
- 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 +2 -0
- data/sig/orb/internal/type/base_model.rbs +4 -0
- data/sig/orb/internal/type/enum.rbs +2 -2
- data/sig/orb/internal/type/{io_like.rbs → file_input.rbs} +1 -1
- data/sig/orb/internal/type/hash_of.rbs +2 -0
- data/sig/orb/internal/type/union.rbs +2 -0
- data/sig/orb/internal/util.rbs +14 -12
- metadata +8 -5
@@ -319,31 +319,90 @@ module Orb
|
|
319
319
|
end
|
320
320
|
def self.new(
|
321
321
|
id:,
|
322
|
+
# The current plan phase that is active, only if the subscription's plan has
|
323
|
+
# phases.
|
322
324
|
active_plan_phase_order:,
|
325
|
+
# The adjustment intervals for this subscription sorted by the start_date of the
|
326
|
+
# adjustment interval.
|
323
327
|
adjustment_intervals:,
|
328
|
+
# Determines whether issued invoices for this subscription will automatically be
|
329
|
+
# charged with the saved payment method on the due date. This property defaults to
|
330
|
+
# the plan's behavior. If null, defaults to the customer's setting.
|
324
331
|
auto_collection:,
|
325
332
|
billing_cycle_anchor_configuration:,
|
333
|
+
# The day of the month on which the billing cycle is anchored. If the maximum
|
334
|
+
# number of days in a month is greater than this value, the last day of the month
|
335
|
+
# is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing
|
336
|
+
# period begins on the 30th.
|
326
337
|
billing_cycle_day:,
|
327
338
|
created_at:,
|
339
|
+
# The end of the current billing period. This is an exclusive timestamp, such that
|
340
|
+
# the instant returned is not part of the billing period. Set to null for
|
341
|
+
# subscriptions that are not currently active.
|
328
342
|
current_billing_period_end_date:,
|
343
|
+
# The start date of the current billing period. This is an inclusive timestamp;
|
344
|
+
# the instant returned is exactly the beginning of the billing period. Set to null
|
345
|
+
# if the subscription is not currently active.
|
329
346
|
current_billing_period_start_date:,
|
347
|
+
# A customer is a buyer of your products, and the other party to the billing
|
348
|
+
# relationship.
|
349
|
+
#
|
350
|
+
# In Orb, customers are assigned system generated identifiers automatically, but
|
351
|
+
# it's often desirable to have these match existing identifiers in your system. To
|
352
|
+
# avoid having to denormalize Orb ID information, you can pass in an
|
353
|
+
# `external_customer_id` with your own identifier. See
|
354
|
+
# [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
|
355
|
+
# information about how these aliases work in Orb.
|
356
|
+
#
|
357
|
+
# In addition to having an identifier in your system, a customer may exist in a
|
358
|
+
# payment provider solution like Stripe. Use the `payment_provider_id` and the
|
359
|
+
# `payment_provider` enum field to express this mapping.
|
360
|
+
#
|
361
|
+
# A customer also has a timezone (from the standard
|
362
|
+
# [IANA timezone database](https://www.iana.org/time-zones)), which defaults to
|
363
|
+
# your account's timezone. See [Timezone localization](/essentials/timezones) for
|
364
|
+
# information on what this timezone parameter influences within Orb.
|
330
365
|
customer:,
|
366
|
+
# Determines the default memo on this subscriptions' invoices. Note that if this
|
367
|
+
# is not provided, it is determined by the plan configuration.
|
331
368
|
default_invoice_memo:,
|
369
|
+
# The discount intervals for this subscription sorted by the start_date.
|
332
370
|
discount_intervals:,
|
371
|
+
# The date Orb stops billing for this subscription.
|
333
372
|
end_date:,
|
334
373
|
fixed_fee_quantity_schedule:,
|
335
374
|
invoicing_threshold:,
|
375
|
+
# The maximum intervals for this subscription sorted by the start_date.
|
336
376
|
maximum_intervals:,
|
377
|
+
# User specified key-value pairs for the resource. If not present, this defaults
|
378
|
+
# to an empty dictionary. Individual keys can be removed by setting the value to
|
379
|
+
# `null`, and the entire metadata mapping can be cleared by setting `metadata` to
|
380
|
+
# `null`.
|
337
381
|
metadata:,
|
382
|
+
# The minimum intervals for this subscription sorted by the start_date.
|
338
383
|
minimum_intervals:,
|
384
|
+
# Determines the difference between the invoice issue date for subscription
|
385
|
+
# invoices as the date that they are due. A value of `0` here represents that the
|
386
|
+
# invoice is due on issue, whereas a value of `30` represents that the customer
|
387
|
+
# has a month to pay the invoice.
|
339
388
|
net_terms:,
|
389
|
+
# A pending subscription change if one exists on this subscription.
|
340
390
|
pending_subscription_change:,
|
391
|
+
# The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
|
392
|
+
# subscribed to by a customer. Plans define the billing behavior of the
|
393
|
+
# subscription. You can see more about how to configure prices in the
|
394
|
+
# [Price resource](/reference/price).
|
341
395
|
plan:,
|
396
|
+
# The price intervals for this subscription.
|
342
397
|
price_intervals:,
|
343
398
|
redeemed_coupon:,
|
399
|
+
# The date Orb starts billing for this subscription.
|
344
400
|
start_date:,
|
345
401
|
status:,
|
346
402
|
trial_info:,
|
403
|
+
# The resources that were changed as part of this operation. Only present when
|
404
|
+
# fetched through the subscription changes API or if the
|
405
|
+
# `include_changed_resources` parameter was passed in the request.
|
347
406
|
changed_resources: nil
|
348
407
|
); end
|
349
408
|
sig do
|
@@ -434,8 +493,16 @@ module Orb
|
|
434
493
|
)
|
435
494
|
.returns(T.attached_class)
|
436
495
|
end
|
437
|
-
def self.new(
|
438
|
-
|
496
|
+
def self.new(
|
497
|
+
id:,
|
498
|
+
adjustment:,
|
499
|
+
# The price interval IDs that this adjustment applies to.
|
500
|
+
applies_to_price_interval_ids:,
|
501
|
+
# The end date of the adjustment interval.
|
502
|
+
end_date:,
|
503
|
+
# The start date of the adjustment interval.
|
504
|
+
start_date:
|
505
|
+
); end
|
439
506
|
sig do
|
440
507
|
override
|
441
508
|
.returns(
|
@@ -502,10 +569,17 @@ module Orb
|
|
502
569
|
end
|
503
570
|
def self.new(
|
504
571
|
id:,
|
572
|
+
# The price IDs that this adjustment applies to.
|
505
573
|
applies_to_price_ids:,
|
574
|
+
# True for adjustments that apply to an entire invocice, false for adjustments
|
575
|
+
# that apply to only one price.
|
506
576
|
is_invoice_level:,
|
577
|
+
# The plan phase in which this adjustment is active.
|
507
578
|
plan_phase_order:,
|
579
|
+
# The reason for the adjustment.
|
508
580
|
reason:,
|
581
|
+
# The number of usage units by which to discount the price this adjustment applies
|
582
|
+
# to in a given billing period.
|
509
583
|
usage_discount:,
|
510
584
|
adjustment_type: :usage_discount
|
511
585
|
); end
|
@@ -569,10 +643,17 @@ module Orb
|
|
569
643
|
end
|
570
644
|
def self.new(
|
571
645
|
id:,
|
646
|
+
# The amount by which to discount the prices this adjustment applies to in a given
|
647
|
+
# billing period.
|
572
648
|
amount_discount:,
|
649
|
+
# The price IDs that this adjustment applies to.
|
573
650
|
applies_to_price_ids:,
|
651
|
+
# True for adjustments that apply to an entire invocice, false for adjustments
|
652
|
+
# that apply to only one price.
|
574
653
|
is_invoice_level:,
|
654
|
+
# The plan phase in which this adjustment is active.
|
575
655
|
plan_phase_order:,
|
656
|
+
# The reason for the adjustment.
|
576
657
|
reason:,
|
577
658
|
adjustment_type: :amount_discount
|
578
659
|
); end
|
@@ -636,10 +717,17 @@ module Orb
|
|
636
717
|
end
|
637
718
|
def self.new(
|
638
719
|
id:,
|
720
|
+
# The price IDs that this adjustment applies to.
|
639
721
|
applies_to_price_ids:,
|
722
|
+
# True for adjustments that apply to an entire invocice, false for adjustments
|
723
|
+
# that apply to only one price.
|
640
724
|
is_invoice_level:,
|
725
|
+
# The percentage (as a value between 0 and 1) by which to discount the price
|
726
|
+
# intervals this adjustment applies to in a given billing period.
|
641
727
|
percentage_discount:,
|
728
|
+
# The plan phase in which this adjustment is active.
|
642
729
|
plan_phase_order:,
|
730
|
+
# The reason for the adjustment.
|
643
731
|
reason:,
|
644
732
|
adjustment_type: :percentage_discount
|
645
733
|
); end
|
@@ -708,11 +796,19 @@ module Orb
|
|
708
796
|
end
|
709
797
|
def self.new(
|
710
798
|
id:,
|
799
|
+
# The price IDs that this adjustment applies to.
|
711
800
|
applies_to_price_ids:,
|
801
|
+
# True for adjustments that apply to an entire invocice, false for adjustments
|
802
|
+
# that apply to only one price.
|
712
803
|
is_invoice_level:,
|
804
|
+
# The item ID that revenue from this minimum will be attributed to.
|
713
805
|
item_id:,
|
806
|
+
# The minimum amount to charge in a given billing period for the prices this
|
807
|
+
# adjustment applies to.
|
714
808
|
minimum_amount:,
|
809
|
+
# The plan phase in which this adjustment is active.
|
715
810
|
plan_phase_order:,
|
811
|
+
# The reason for the adjustment.
|
716
812
|
reason:,
|
717
813
|
adjustment_type: :minimum
|
718
814
|
); end
|
@@ -777,10 +873,17 @@ module Orb
|
|
777
873
|
end
|
778
874
|
def self.new(
|
779
875
|
id:,
|
876
|
+
# The price IDs that this adjustment applies to.
|
780
877
|
applies_to_price_ids:,
|
878
|
+
# True for adjustments that apply to an entire invocice, false for adjustments
|
879
|
+
# that apply to only one price.
|
781
880
|
is_invoice_level:,
|
881
|
+
# The maximum amount to charge in a given billing period for the prices this
|
882
|
+
# adjustment applies to.
|
782
883
|
maximum_amount:,
|
884
|
+
# The plan phase in which this adjustment is active.
|
783
885
|
plan_phase_order:,
|
886
|
+
# The reason for the adjustment.
|
784
887
|
reason:,
|
785
888
|
adjustment_type: :maximum
|
786
889
|
); end
|
@@ -833,8 +936,20 @@ module Orb
|
|
833
936
|
sig do
|
834
937
|
params(day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)).returns(T.attached_class)
|
835
938
|
end
|
836
|
-
def self.new(
|
837
|
-
|
939
|
+
def self.new(
|
940
|
+
# The day of the month on which the billing cycle is anchored. If the maximum
|
941
|
+
# number of days in a month is greater than this value, the last day of the month
|
942
|
+
# is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing
|
943
|
+
# period begins on the 30th.
|
944
|
+
day:,
|
945
|
+
# The month on which the billing cycle is anchored (e.g. a quarterly price
|
946
|
+
# anchored in February would have cycles starting February, May, August, and
|
947
|
+
# November).
|
948
|
+
month: nil,
|
949
|
+
# The year on which the billing cycle is anchored (e.g. a 2 year billing cycle
|
950
|
+
# anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.).
|
951
|
+
year: nil
|
952
|
+
); end
|
838
953
|
sig { override.returns({day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)}) }
|
839
954
|
def to_hash; end
|
840
955
|
end
|
@@ -878,10 +993,15 @@ module Orb
|
|
878
993
|
.returns(T.attached_class)
|
879
994
|
end
|
880
995
|
def self.new(
|
996
|
+
# Only available if discount_type is `amount`.
|
881
997
|
amount_discount:,
|
998
|
+
# The price ids that this discount interval applies to.
|
882
999
|
applies_to_price_ids:,
|
1000
|
+
# The price interval ids that this discount interval applies to.
|
883
1001
|
applies_to_price_interval_ids:,
|
1002
|
+
# The end date of the discount interval.
|
884
1003
|
end_date:,
|
1004
|
+
# The start date of the discount interval.
|
885
1005
|
start_date:,
|
886
1006
|
discount_type: :amount
|
887
1007
|
); end
|
@@ -938,10 +1058,16 @@ module Orb
|
|
938
1058
|
.returns(T.attached_class)
|
939
1059
|
end
|
940
1060
|
def self.new(
|
1061
|
+
# The price ids that this discount interval applies to.
|
941
1062
|
applies_to_price_ids:,
|
1063
|
+
# The price interval ids that this discount interval applies to.
|
942
1064
|
applies_to_price_interval_ids:,
|
1065
|
+
# The end date of the discount interval.
|
943
1066
|
end_date:,
|
1067
|
+
# Only available if discount_type is `percentage`.This is a number between 0
|
1068
|
+
# and 1.
|
944
1069
|
percentage_discount:,
|
1070
|
+
# The start date of the discount interval.
|
945
1071
|
start_date:,
|
946
1072
|
discount_type: :percentage
|
947
1073
|
); end
|
@@ -998,10 +1124,16 @@ module Orb
|
|
998
1124
|
.returns(T.attached_class)
|
999
1125
|
end
|
1000
1126
|
def self.new(
|
1127
|
+
# The price ids that this discount interval applies to.
|
1001
1128
|
applies_to_price_ids:,
|
1129
|
+
# The price interval ids that this discount interval applies to.
|
1002
1130
|
applies_to_price_interval_ids:,
|
1131
|
+
# The end date of the discount interval.
|
1003
1132
|
end_date:,
|
1133
|
+
# The start date of the discount interval.
|
1004
1134
|
start_date:,
|
1135
|
+
# Only available if discount_type is `usage`. Number of usage units that this
|
1136
|
+
# discount is for
|
1005
1137
|
usage_discount:,
|
1006
1138
|
discount_type: :usage
|
1007
1139
|
); end
|
@@ -1088,14 +1220,18 @@ module Orb
|
|
1088
1220
|
.returns(T.attached_class)
|
1089
1221
|
end
|
1090
1222
|
def self.new(
|
1223
|
+
# The price ids that this maximum interval applies to.
|
1091
1224
|
applies_to_price_ids:,
|
1225
|
+
# The price interval ids that this maximum interval applies to.
|
1092
1226
|
applies_to_price_interval_ids:,
|
1227
|
+
# The end date of the maximum interval.
|
1093
1228
|
end_date:,
|
1229
|
+
# The maximum amount to charge in a given billing period for the price intervals
|
1230
|
+
# this transform applies to.
|
1094
1231
|
maximum_amount:,
|
1232
|
+
# The start date of the maximum interval.
|
1095
1233
|
start_date:
|
1096
|
-
)
|
1097
|
-
end
|
1098
|
-
|
1234
|
+
); end
|
1099
1235
|
sig do
|
1100
1236
|
override
|
1101
1237
|
.returns(
|
@@ -1144,14 +1280,18 @@ module Orb
|
|
1144
1280
|
.returns(T.attached_class)
|
1145
1281
|
end
|
1146
1282
|
def self.new(
|
1283
|
+
# The price ids that this minimum interval applies to.
|
1147
1284
|
applies_to_price_ids:,
|
1285
|
+
# The price interval ids that this minimum interval applies to.
|
1148
1286
|
applies_to_price_interval_ids:,
|
1287
|
+
# The end date of the minimum interval.
|
1149
1288
|
end_date:,
|
1289
|
+
# The minimum amount to charge in a given billing period for the price intervals
|
1290
|
+
# this minimum applies to.
|
1150
1291
|
minimum_amount:,
|
1292
|
+
# The start date of the minimum interval.
|
1151
1293
|
start_date:
|
1152
|
-
)
|
1153
|
-
end
|
1154
|
-
|
1294
|
+
); end
|
1155
1295
|
sig do
|
1156
1296
|
override
|
1157
1297
|
.returns(
|
@@ -1334,14 +1474,40 @@ module Orb
|
|
1334
1474
|
end
|
1335
1475
|
def self.new(
|
1336
1476
|
id:,
|
1477
|
+
# The day of the month that Orb bills for this price
|
1337
1478
|
billing_cycle_day:,
|
1479
|
+
# The end of the current billing period. This is an exclusive timestamp, such that
|
1480
|
+
# the instant returned is exactly the end of the billing period. Set to null if
|
1481
|
+
# this price interval is not currently active.
|
1338
1482
|
current_billing_period_end_date:,
|
1483
|
+
# The start date of the current billing period. This is an inclusive timestamp;
|
1484
|
+
# the instant returned is exactly the beginning of the billing period. Set to null
|
1485
|
+
# if this price interval is not currently active.
|
1339
1486
|
current_billing_period_start_date:,
|
1487
|
+
# The end date of the price interval. This is the date that Orb stops billing for
|
1488
|
+
# this price.
|
1340
1489
|
end_date:,
|
1490
|
+
# An additional filter to apply to usage queries.
|
1341
1491
|
filter:,
|
1492
|
+
# The fixed fee quantity transitions for this price interval. This is only
|
1493
|
+
# relevant for fixed fees.
|
1342
1494
|
fixed_fee_quantity_transitions:,
|
1495
|
+
# The Price resource represents a price that can be billed on a subscription,
|
1496
|
+
# resulting in a charge on an invoice in the form of an invoice line item. Prices
|
1497
|
+
# take a quantity and determine an amount to bill.
|
1498
|
+
#
|
1499
|
+
# Orb supports a few different pricing models out of the box. Each of these models
|
1500
|
+
# is serialized differently in a given Price object. The model_type field
|
1501
|
+
# determines the key for the configuration object that is present.
|
1502
|
+
#
|
1503
|
+
# For more on the types of prices, see
|
1504
|
+
# [the core concepts documentation](/core-concepts#plan-and-price)
|
1343
1505
|
price:,
|
1506
|
+
# The start date of the price interval. This is the date that Orb starts billing
|
1507
|
+
# for this price.
|
1344
1508
|
start_date:,
|
1509
|
+
# A list of customer IDs whose usage events will be aggregated and billed under
|
1510
|
+
# this price interval.
|
1345
1511
|
usage_customer_ids:
|
1346
1512
|
); end
|
1347
1513
|
sig do
|
@@ -1438,14 +1604,7 @@ module Orb
|
|
1438
1604
|
|
1439
1605
|
TaggedSymbol =
|
1440
1606
|
T.type_alias { T.all(Symbol, Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::Status) }
|
1441
|
-
OrSymbol =
|
1442
|
-
T.type_alias do
|
1443
|
-
T.any(
|
1444
|
-
Symbol,
|
1445
|
-
String,
|
1446
|
-
Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::Status::TaggedSymbol
|
1447
|
-
)
|
1448
|
-
end
|
1607
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
1449
1608
|
|
1450
1609
|
ACTIVE =
|
1451
1610
|
T.let(:active, Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::Status::TaggedSymbol)
|
@@ -1503,8 +1662,16 @@ module Orb
|
|
1503
1662
|
)
|
1504
1663
|
.returns(T.attached_class)
|
1505
1664
|
end
|
1506
|
-
def self.new(
|
1507
|
-
|
1665
|
+
def self.new(
|
1666
|
+
# The credit notes that were created as part of this operation.
|
1667
|
+
created_credit_notes:,
|
1668
|
+
# The invoices that were created as part of this operation.
|
1669
|
+
created_invoices:,
|
1670
|
+
# The credit notes that were voided as part of this operation.
|
1671
|
+
voided_credit_notes:,
|
1672
|
+
# The invoices that were voided as part of this operation.
|
1673
|
+
voided_invoices:
|
1674
|
+
); end
|
1508
1675
|
sig do
|
1509
1676
|
override
|
1510
1677
|
.returns(
|