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
@@ -239,31 +239,90 @@ module Orb
|
|
239
239
|
end
|
240
240
|
def self.new(
|
241
241
|
id:,
|
242
|
+
# The current plan phase that is active, only if the subscription's plan has
|
243
|
+
# phases.
|
242
244
|
active_plan_phase_order:,
|
245
|
+
# The adjustment intervals for this subscription sorted by the start_date of the
|
246
|
+
# adjustment interval.
|
243
247
|
adjustment_intervals:,
|
248
|
+
# Determines whether issued invoices for this subscription will automatically be
|
249
|
+
# charged with the saved payment method on the due date. This property defaults to
|
250
|
+
# the plan's behavior. If null, defaults to the customer's setting.
|
244
251
|
auto_collection:,
|
245
252
|
billing_cycle_anchor_configuration:,
|
253
|
+
# The day of the month on which the billing cycle is anchored. If the maximum
|
254
|
+
# number of days in a month is greater than this value, the last day of the month
|
255
|
+
# is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing
|
256
|
+
# period begins on the 30th.
|
246
257
|
billing_cycle_day:,
|
247
258
|
created_at:,
|
259
|
+
# The end of the current billing period. This is an exclusive timestamp, such that
|
260
|
+
# the instant returned is not part of the billing period. Set to null for
|
261
|
+
# subscriptions that are not currently active.
|
248
262
|
current_billing_period_end_date:,
|
263
|
+
# The start date of the current billing period. This is an inclusive timestamp;
|
264
|
+
# the instant returned is exactly the beginning of the billing period. Set to null
|
265
|
+
# if the subscription is not currently active.
|
249
266
|
current_billing_period_start_date:,
|
267
|
+
# A customer is a buyer of your products, and the other party to the billing
|
268
|
+
# relationship.
|
269
|
+
#
|
270
|
+
# In Orb, customers are assigned system generated identifiers automatically, but
|
271
|
+
# it's often desirable to have these match existing identifiers in your system. To
|
272
|
+
# avoid having to denormalize Orb ID information, you can pass in an
|
273
|
+
# `external_customer_id` with your own identifier. See
|
274
|
+
# [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
|
275
|
+
# information about how these aliases work in Orb.
|
276
|
+
#
|
277
|
+
# In addition to having an identifier in your system, a customer may exist in a
|
278
|
+
# payment provider solution like Stripe. Use the `payment_provider_id` and the
|
279
|
+
# `payment_provider` enum field to express this mapping.
|
280
|
+
#
|
281
|
+
# A customer also has a timezone (from the standard
|
282
|
+
# [IANA timezone database](https://www.iana.org/time-zones)), which defaults to
|
283
|
+
# your account's timezone. See [Timezone localization](/essentials/timezones) for
|
284
|
+
# information on what this timezone parameter influences within Orb.
|
250
285
|
customer:,
|
286
|
+
# Determines the default memo on this subscriptions' invoices. Note that if this
|
287
|
+
# is not provided, it is determined by the plan configuration.
|
251
288
|
default_invoice_memo:,
|
289
|
+
# The discount intervals for this subscription sorted by the start_date.
|
252
290
|
discount_intervals:,
|
291
|
+
# The date Orb stops billing for this subscription.
|
253
292
|
end_date:,
|
254
293
|
fixed_fee_quantity_schedule:,
|
255
294
|
invoicing_threshold:,
|
295
|
+
# The maximum intervals for this subscription sorted by the start_date.
|
256
296
|
maximum_intervals:,
|
297
|
+
# User specified key-value pairs for the resource. If not present, this defaults
|
298
|
+
# to an empty dictionary. Individual keys can be removed by setting the value to
|
299
|
+
# `null`, and the entire metadata mapping can be cleared by setting `metadata` to
|
300
|
+
# `null`.
|
257
301
|
metadata:,
|
302
|
+
# The minimum intervals for this subscription sorted by the start_date.
|
258
303
|
minimum_intervals:,
|
304
|
+
# Determines the difference between the invoice issue date for subscription
|
305
|
+
# invoices as the date that they are due. A value of `0` here represents that the
|
306
|
+
# invoice is due on issue, whereas a value of `30` represents that the customer
|
307
|
+
# has a month to pay the invoice.
|
259
308
|
net_terms:,
|
309
|
+
# A pending subscription change if one exists on this subscription.
|
260
310
|
pending_subscription_change:,
|
311
|
+
# The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
|
312
|
+
# subscribed to by a customer. Plans define the billing behavior of the
|
313
|
+
# subscription. You can see more about how to configure prices in the
|
314
|
+
# [Price resource](/reference/price).
|
261
315
|
plan:,
|
316
|
+
# The price intervals for this subscription.
|
262
317
|
price_intervals:,
|
263
318
|
redeemed_coupon:,
|
319
|
+
# The date Orb starts billing for this subscription.
|
264
320
|
start_date:,
|
265
321
|
status:,
|
266
322
|
trial_info:,
|
323
|
+
# The resources that were changed as part of this operation. Only present when
|
324
|
+
# fetched through the subscription changes API or if the
|
325
|
+
# `include_changed_resources` parameter was passed in the request.
|
267
326
|
changed_resources: nil
|
268
327
|
); end
|
269
328
|
sig do
|
@@ -354,8 +413,16 @@ module Orb
|
|
354
413
|
)
|
355
414
|
.returns(T.attached_class)
|
356
415
|
end
|
357
|
-
def self.new(
|
358
|
-
|
416
|
+
def self.new(
|
417
|
+
id:,
|
418
|
+
adjustment:,
|
419
|
+
# The price interval IDs that this adjustment applies to.
|
420
|
+
applies_to_price_interval_ids:,
|
421
|
+
# The end date of the adjustment interval.
|
422
|
+
end_date:,
|
423
|
+
# The start date of the adjustment interval.
|
424
|
+
start_date:
|
425
|
+
); end
|
359
426
|
sig do
|
360
427
|
override
|
361
428
|
.returns(
|
@@ -422,10 +489,17 @@ module Orb
|
|
422
489
|
end
|
423
490
|
def self.new(
|
424
491
|
id:,
|
492
|
+
# The price IDs that this adjustment applies to.
|
425
493
|
applies_to_price_ids:,
|
494
|
+
# True for adjustments that apply to an entire invocice, false for adjustments
|
495
|
+
# that apply to only one price.
|
426
496
|
is_invoice_level:,
|
497
|
+
# The plan phase in which this adjustment is active.
|
427
498
|
plan_phase_order:,
|
499
|
+
# The reason for the adjustment.
|
428
500
|
reason:,
|
501
|
+
# The number of usage units by which to discount the price this adjustment applies
|
502
|
+
# to in a given billing period.
|
429
503
|
usage_discount:,
|
430
504
|
adjustment_type: :usage_discount
|
431
505
|
); end
|
@@ -489,10 +563,17 @@ module Orb
|
|
489
563
|
end
|
490
564
|
def self.new(
|
491
565
|
id:,
|
566
|
+
# The amount by which to discount the prices this adjustment applies to in a given
|
567
|
+
# billing period.
|
492
568
|
amount_discount:,
|
569
|
+
# The price IDs that this adjustment applies to.
|
493
570
|
applies_to_price_ids:,
|
571
|
+
# True for adjustments that apply to an entire invocice, false for adjustments
|
572
|
+
# that apply to only one price.
|
494
573
|
is_invoice_level:,
|
574
|
+
# The plan phase in which this adjustment is active.
|
495
575
|
plan_phase_order:,
|
576
|
+
# The reason for the adjustment.
|
496
577
|
reason:,
|
497
578
|
adjustment_type: :amount_discount
|
498
579
|
); end
|
@@ -556,10 +637,17 @@ module Orb
|
|
556
637
|
end
|
557
638
|
def self.new(
|
558
639
|
id:,
|
640
|
+
# The price IDs that this adjustment applies to.
|
559
641
|
applies_to_price_ids:,
|
642
|
+
# True for adjustments that apply to an entire invocice, false for adjustments
|
643
|
+
# that apply to only one price.
|
560
644
|
is_invoice_level:,
|
645
|
+
# The percentage (as a value between 0 and 1) by which to discount the price
|
646
|
+
# intervals this adjustment applies to in a given billing period.
|
561
647
|
percentage_discount:,
|
648
|
+
# The plan phase in which this adjustment is active.
|
562
649
|
plan_phase_order:,
|
650
|
+
# The reason for the adjustment.
|
563
651
|
reason:,
|
564
652
|
adjustment_type: :percentage_discount
|
565
653
|
); end
|
@@ -628,11 +716,19 @@ module Orb
|
|
628
716
|
end
|
629
717
|
def self.new(
|
630
718
|
id:,
|
719
|
+
# The price IDs that this adjustment applies to.
|
631
720
|
applies_to_price_ids:,
|
721
|
+
# True for adjustments that apply to an entire invocice, false for adjustments
|
722
|
+
# that apply to only one price.
|
632
723
|
is_invoice_level:,
|
724
|
+
# The item ID that revenue from this minimum will be attributed to.
|
633
725
|
item_id:,
|
726
|
+
# The minimum amount to charge in a given billing period for the prices this
|
727
|
+
# adjustment applies to.
|
634
728
|
minimum_amount:,
|
729
|
+
# The plan phase in which this adjustment is active.
|
635
730
|
plan_phase_order:,
|
731
|
+
# The reason for the adjustment.
|
636
732
|
reason:,
|
637
733
|
adjustment_type: :minimum
|
638
734
|
); end
|
@@ -697,10 +793,17 @@ module Orb
|
|
697
793
|
end
|
698
794
|
def self.new(
|
699
795
|
id:,
|
796
|
+
# The price IDs that this adjustment applies to.
|
700
797
|
applies_to_price_ids:,
|
798
|
+
# True for adjustments that apply to an entire invocice, false for adjustments
|
799
|
+
# that apply to only one price.
|
701
800
|
is_invoice_level:,
|
801
|
+
# The maximum amount to charge in a given billing period for the prices this
|
802
|
+
# adjustment applies to.
|
702
803
|
maximum_amount:,
|
804
|
+
# The plan phase in which this adjustment is active.
|
703
805
|
plan_phase_order:,
|
806
|
+
# The reason for the adjustment.
|
704
807
|
reason:,
|
705
808
|
adjustment_type: :maximum
|
706
809
|
); end
|
@@ -753,8 +856,20 @@ module Orb
|
|
753
856
|
sig do
|
754
857
|
params(day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)).returns(T.attached_class)
|
755
858
|
end
|
756
|
-
def self.new(
|
757
|
-
|
859
|
+
def self.new(
|
860
|
+
# The day of the month on which the billing cycle is anchored. If the maximum
|
861
|
+
# number of days in a month is greater than this value, the last day of the month
|
862
|
+
# is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing
|
863
|
+
# period begins on the 30th.
|
864
|
+
day:,
|
865
|
+
# The month on which the billing cycle is anchored (e.g. a quarterly price
|
866
|
+
# anchored in February would have cycles starting February, May, August, and
|
867
|
+
# November).
|
868
|
+
month: nil,
|
869
|
+
# The year on which the billing cycle is anchored (e.g. a 2 year billing cycle
|
870
|
+
# anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.).
|
871
|
+
year: nil
|
872
|
+
); end
|
758
873
|
sig { override.returns({day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)}) }
|
759
874
|
def to_hash; end
|
760
875
|
end
|
@@ -798,10 +913,15 @@ module Orb
|
|
798
913
|
.returns(T.attached_class)
|
799
914
|
end
|
800
915
|
def self.new(
|
916
|
+
# Only available if discount_type is `amount`.
|
801
917
|
amount_discount:,
|
918
|
+
# The price ids that this discount interval applies to.
|
802
919
|
applies_to_price_ids:,
|
920
|
+
# The price interval ids that this discount interval applies to.
|
803
921
|
applies_to_price_interval_ids:,
|
922
|
+
# The end date of the discount interval.
|
804
923
|
end_date:,
|
924
|
+
# The start date of the discount interval.
|
805
925
|
start_date:,
|
806
926
|
discount_type: :amount
|
807
927
|
); end
|
@@ -858,10 +978,16 @@ module Orb
|
|
858
978
|
.returns(T.attached_class)
|
859
979
|
end
|
860
980
|
def self.new(
|
981
|
+
# The price ids that this discount interval applies to.
|
861
982
|
applies_to_price_ids:,
|
983
|
+
# The price interval ids that this discount interval applies to.
|
862
984
|
applies_to_price_interval_ids:,
|
985
|
+
# The end date of the discount interval.
|
863
986
|
end_date:,
|
987
|
+
# Only available if discount_type is `percentage`.This is a number between 0
|
988
|
+
# and 1.
|
864
989
|
percentage_discount:,
|
990
|
+
# The start date of the discount interval.
|
865
991
|
start_date:,
|
866
992
|
discount_type: :percentage
|
867
993
|
); end
|
@@ -918,10 +1044,16 @@ module Orb
|
|
918
1044
|
.returns(T.attached_class)
|
919
1045
|
end
|
920
1046
|
def self.new(
|
1047
|
+
# The price ids that this discount interval applies to.
|
921
1048
|
applies_to_price_ids:,
|
1049
|
+
# The price interval ids that this discount interval applies to.
|
922
1050
|
applies_to_price_interval_ids:,
|
1051
|
+
# The end date of the discount interval.
|
923
1052
|
end_date:,
|
1053
|
+
# The start date of the discount interval.
|
924
1054
|
start_date:,
|
1055
|
+
# Only available if discount_type is `usage`. Number of usage units that this
|
1056
|
+
# discount is for
|
925
1057
|
usage_discount:,
|
926
1058
|
discount_type: :usage
|
927
1059
|
); end
|
@@ -1008,14 +1140,18 @@ module Orb
|
|
1008
1140
|
.returns(T.attached_class)
|
1009
1141
|
end
|
1010
1142
|
def self.new(
|
1143
|
+
# The price ids that this maximum interval applies to.
|
1011
1144
|
applies_to_price_ids:,
|
1145
|
+
# The price interval ids that this maximum interval applies to.
|
1012
1146
|
applies_to_price_interval_ids:,
|
1147
|
+
# The end date of the maximum interval.
|
1013
1148
|
end_date:,
|
1149
|
+
# The maximum amount to charge in a given billing period for the price intervals
|
1150
|
+
# this transform applies to.
|
1014
1151
|
maximum_amount:,
|
1152
|
+
# The start date of the maximum interval.
|
1015
1153
|
start_date:
|
1016
|
-
)
|
1017
|
-
end
|
1018
|
-
|
1154
|
+
); end
|
1019
1155
|
sig do
|
1020
1156
|
override
|
1021
1157
|
.returns(
|
@@ -1064,14 +1200,18 @@ module Orb
|
|
1064
1200
|
.returns(T.attached_class)
|
1065
1201
|
end
|
1066
1202
|
def self.new(
|
1203
|
+
# The price ids that this minimum interval applies to.
|
1067
1204
|
applies_to_price_ids:,
|
1205
|
+
# The price interval ids that this minimum interval applies to.
|
1068
1206
|
applies_to_price_interval_ids:,
|
1207
|
+
# The end date of the minimum interval.
|
1069
1208
|
end_date:,
|
1209
|
+
# The minimum amount to charge in a given billing period for the price intervals
|
1210
|
+
# this minimum applies to.
|
1070
1211
|
minimum_amount:,
|
1212
|
+
# The start date of the minimum interval.
|
1071
1213
|
start_date:
|
1072
|
-
)
|
1073
|
-
end
|
1074
|
-
|
1214
|
+
); end
|
1075
1215
|
sig do
|
1076
1216
|
override
|
1077
1217
|
.returns(
|
@@ -1250,14 +1390,40 @@ module Orb
|
|
1250
1390
|
end
|
1251
1391
|
def self.new(
|
1252
1392
|
id:,
|
1393
|
+
# The day of the month that Orb bills for this price
|
1253
1394
|
billing_cycle_day:,
|
1395
|
+
# The end of the current billing period. This is an exclusive timestamp, such that
|
1396
|
+
# the instant returned is exactly the end of the billing period. Set to null if
|
1397
|
+
# this price interval is not currently active.
|
1254
1398
|
current_billing_period_end_date:,
|
1399
|
+
# The start date of the current billing period. This is an inclusive timestamp;
|
1400
|
+
# the instant returned is exactly the beginning of the billing period. Set to null
|
1401
|
+
# if this price interval is not currently active.
|
1255
1402
|
current_billing_period_start_date:,
|
1403
|
+
# The end date of the price interval. This is the date that Orb stops billing for
|
1404
|
+
# this price.
|
1256
1405
|
end_date:,
|
1406
|
+
# An additional filter to apply to usage queries.
|
1257
1407
|
filter:,
|
1408
|
+
# The fixed fee quantity transitions for this price interval. This is only
|
1409
|
+
# relevant for fixed fees.
|
1258
1410
|
fixed_fee_quantity_transitions:,
|
1411
|
+
# The Price resource represents a price that can be billed on a subscription,
|
1412
|
+
# resulting in a charge on an invoice in the form of an invoice line item. Prices
|
1413
|
+
# take a quantity and determine an amount to bill.
|
1414
|
+
#
|
1415
|
+
# Orb supports a few different pricing models out of the box. Each of these models
|
1416
|
+
# is serialized differently in a given Price object. The model_type field
|
1417
|
+
# determines the key for the configuration object that is present.
|
1418
|
+
#
|
1419
|
+
# For more on the types of prices, see
|
1420
|
+
# [the core concepts documentation](/core-concepts#plan-and-price)
|
1259
1421
|
price:,
|
1422
|
+
# The start date of the price interval. This is the date that Orb starts billing
|
1423
|
+
# for this price.
|
1260
1424
|
start_date:,
|
1425
|
+
# A list of customer IDs whose usage events will be aggregated and billed under
|
1426
|
+
# this price interval.
|
1261
1427
|
usage_customer_ids:
|
1262
1428
|
); end
|
1263
1429
|
sig do
|
@@ -1349,8 +1515,7 @@ module Orb
|
|
1349
1515
|
extend Orb::Internal::Type::Enum
|
1350
1516
|
|
1351
1517
|
TaggedSymbol = T.type_alias { T.all(Symbol, Orb::Models::SubscriptionCancelResponse::Status) }
|
1352
|
-
OrSymbol =
|
1353
|
-
T.type_alias { T.any(Symbol, String, Orb::Models::SubscriptionCancelResponse::Status::TaggedSymbol) }
|
1518
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
1354
1519
|
|
1355
1520
|
ACTIVE = T.let(:active, Orb::Models::SubscriptionCancelResponse::Status::TaggedSymbol)
|
1356
1521
|
ENDED = T.let(:ended, Orb::Models::SubscriptionCancelResponse::Status::TaggedSymbol)
|
@@ -1400,8 +1565,16 @@ module Orb
|
|
1400
1565
|
)
|
1401
1566
|
.returns(T.attached_class)
|
1402
1567
|
end
|
1403
|
-
def self.new(
|
1404
|
-
|
1568
|
+
def self.new(
|
1569
|
+
# The credit notes that were created as part of this operation.
|
1570
|
+
created_credit_notes:,
|
1571
|
+
# The invoices that were created as part of this operation.
|
1572
|
+
created_invoices:,
|
1573
|
+
# The credit notes that were voided as part of this operation.
|
1574
|
+
voided_credit_notes:,
|
1575
|
+
# The invoices that were voided as part of this operation.
|
1576
|
+
voided_invoices:
|
1577
|
+
); end
|
1405
1578
|
sig do
|
1406
1579
|
override
|
1407
1580
|
.returns(
|
@@ -22,8 +22,13 @@ module Orb
|
|
22
22
|
)
|
23
23
|
.returns(T.attached_class)
|
24
24
|
end
|
25
|
-
def self.new(
|
26
|
-
|
25
|
+
def self.new(
|
26
|
+
# Description to apply to the balance transaction representing this credit.
|
27
|
+
description: nil,
|
28
|
+
# Amount already collected to apply to the customer's balance.
|
29
|
+
previously_collected_amount: nil,
|
30
|
+
request_options: {}
|
31
|
+
); end
|
27
32
|
sig do
|
28
33
|
override
|
29
34
|
.returns(
|