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
@@ -250,31 +250,90 @@ module Orb
|
|
250
250
|
end
|
251
251
|
def self.new(
|
252
252
|
id:,
|
253
|
+
# The current plan phase that is active, only if the subscription's plan has
|
254
|
+
# phases.
|
253
255
|
active_plan_phase_order:,
|
256
|
+
# The adjustment intervals for this subscription sorted by the start_date of the
|
257
|
+
# adjustment interval.
|
254
258
|
adjustment_intervals:,
|
259
|
+
# Determines whether issued invoices for this subscription will automatically be
|
260
|
+
# charged with the saved payment method on the due date. This property defaults to
|
261
|
+
# the plan's behavior. If null, defaults to the customer's setting.
|
255
262
|
auto_collection:,
|
256
263
|
billing_cycle_anchor_configuration:,
|
264
|
+
# The day of the month on which the billing cycle is anchored. If the maximum
|
265
|
+
# number of days in a month is greater than this value, the last day of the month
|
266
|
+
# is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing
|
267
|
+
# period begins on the 30th.
|
257
268
|
billing_cycle_day:,
|
258
269
|
created_at:,
|
270
|
+
# The end of the current billing period. This is an exclusive timestamp, such that
|
271
|
+
# the instant returned is not part of the billing period. Set to null for
|
272
|
+
# subscriptions that are not currently active.
|
259
273
|
current_billing_period_end_date:,
|
274
|
+
# The start date of the current billing period. This is an inclusive timestamp;
|
275
|
+
# the instant returned is exactly the beginning of the billing period. Set to null
|
276
|
+
# if the subscription is not currently active.
|
260
277
|
current_billing_period_start_date:,
|
278
|
+
# A customer is a buyer of your products, and the other party to the billing
|
279
|
+
# relationship.
|
280
|
+
#
|
281
|
+
# In Orb, customers are assigned system generated identifiers automatically, but
|
282
|
+
# it's often desirable to have these match existing identifiers in your system. To
|
283
|
+
# avoid having to denormalize Orb ID information, you can pass in an
|
284
|
+
# `external_customer_id` with your own identifier. See
|
285
|
+
# [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
|
286
|
+
# information about how these aliases work in Orb.
|
287
|
+
#
|
288
|
+
# In addition to having an identifier in your system, a customer may exist in a
|
289
|
+
# payment provider solution like Stripe. Use the `payment_provider_id` and the
|
290
|
+
# `payment_provider` enum field to express this mapping.
|
291
|
+
#
|
292
|
+
# A customer also has a timezone (from the standard
|
293
|
+
# [IANA timezone database](https://www.iana.org/time-zones)), which defaults to
|
294
|
+
# your account's timezone. See [Timezone localization](/essentials/timezones) for
|
295
|
+
# information on what this timezone parameter influences within Orb.
|
261
296
|
customer:,
|
297
|
+
# Determines the default memo on this subscriptions' invoices. Note that if this
|
298
|
+
# is not provided, it is determined by the plan configuration.
|
262
299
|
default_invoice_memo:,
|
300
|
+
# The discount intervals for this subscription sorted by the start_date.
|
263
301
|
discount_intervals:,
|
302
|
+
# The date Orb stops billing for this subscription.
|
264
303
|
end_date:,
|
265
304
|
fixed_fee_quantity_schedule:,
|
266
305
|
invoicing_threshold:,
|
306
|
+
# The maximum intervals for this subscription sorted by the start_date.
|
267
307
|
maximum_intervals:,
|
308
|
+
# User specified key-value pairs for the resource. If not present, this defaults
|
309
|
+
# to an empty dictionary. Individual keys can be removed by setting the value to
|
310
|
+
# `null`, and the entire metadata mapping can be cleared by setting `metadata` to
|
311
|
+
# `null`.
|
268
312
|
metadata:,
|
313
|
+
# The minimum intervals for this subscription sorted by the start_date.
|
269
314
|
minimum_intervals:,
|
315
|
+
# Determines the difference between the invoice issue date for subscription
|
316
|
+
# invoices as the date that they are due. A value of `0` here represents that the
|
317
|
+
# invoice is due on issue, whereas a value of `30` represents that the customer
|
318
|
+
# has a month to pay the invoice.
|
270
319
|
net_terms:,
|
320
|
+
# A pending subscription change if one exists on this subscription.
|
271
321
|
pending_subscription_change:,
|
322
|
+
# The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
|
323
|
+
# subscribed to by a customer. Plans define the billing behavior of the
|
324
|
+
# subscription. You can see more about how to configure prices in the
|
325
|
+
# [Price resource](/reference/price).
|
272
326
|
plan:,
|
327
|
+
# The price intervals for this subscription.
|
273
328
|
price_intervals:,
|
274
329
|
redeemed_coupon:,
|
330
|
+
# The date Orb starts billing for this subscription.
|
275
331
|
start_date:,
|
276
332
|
status:,
|
277
333
|
trial_info:,
|
334
|
+
# The resources that were changed as part of this operation. Only present when
|
335
|
+
# fetched through the subscription changes API or if the
|
336
|
+
# `include_changed_resources` parameter was passed in the request.
|
278
337
|
changed_resources: nil
|
279
338
|
); end
|
280
339
|
sig do
|
@@ -365,8 +424,16 @@ module Orb
|
|
365
424
|
)
|
366
425
|
.returns(T.attached_class)
|
367
426
|
end
|
368
|
-
def self.new(
|
369
|
-
|
427
|
+
def self.new(
|
428
|
+
id:,
|
429
|
+
adjustment:,
|
430
|
+
# The price interval IDs that this adjustment applies to.
|
431
|
+
applies_to_price_interval_ids:,
|
432
|
+
# The end date of the adjustment interval.
|
433
|
+
end_date:,
|
434
|
+
# The start date of the adjustment interval.
|
435
|
+
start_date:
|
436
|
+
); end
|
370
437
|
sig do
|
371
438
|
override
|
372
439
|
.returns(
|
@@ -433,10 +500,17 @@ module Orb
|
|
433
500
|
end
|
434
501
|
def self.new(
|
435
502
|
id:,
|
503
|
+
# The price IDs that this adjustment applies to.
|
436
504
|
applies_to_price_ids:,
|
505
|
+
# True for adjustments that apply to an entire invocice, false for adjustments
|
506
|
+
# that apply to only one price.
|
437
507
|
is_invoice_level:,
|
508
|
+
# The plan phase in which this adjustment is active.
|
438
509
|
plan_phase_order:,
|
510
|
+
# The reason for the adjustment.
|
439
511
|
reason:,
|
512
|
+
# The number of usage units by which to discount the price this adjustment applies
|
513
|
+
# to in a given billing period.
|
440
514
|
usage_discount:,
|
441
515
|
adjustment_type: :usage_discount
|
442
516
|
); end
|
@@ -500,10 +574,17 @@ module Orb
|
|
500
574
|
end
|
501
575
|
def self.new(
|
502
576
|
id:,
|
577
|
+
# The amount by which to discount the prices this adjustment applies to in a given
|
578
|
+
# billing period.
|
503
579
|
amount_discount:,
|
580
|
+
# The price IDs that this adjustment applies to.
|
504
581
|
applies_to_price_ids:,
|
582
|
+
# True for adjustments that apply to an entire invocice, false for adjustments
|
583
|
+
# that apply to only one price.
|
505
584
|
is_invoice_level:,
|
585
|
+
# The plan phase in which this adjustment is active.
|
506
586
|
plan_phase_order:,
|
587
|
+
# The reason for the adjustment.
|
507
588
|
reason:,
|
508
589
|
adjustment_type: :amount_discount
|
509
590
|
); end
|
@@ -567,10 +648,17 @@ module Orb
|
|
567
648
|
end
|
568
649
|
def self.new(
|
569
650
|
id:,
|
651
|
+
# The price IDs that this adjustment applies to.
|
570
652
|
applies_to_price_ids:,
|
653
|
+
# True for adjustments that apply to an entire invocice, false for adjustments
|
654
|
+
# that apply to only one price.
|
571
655
|
is_invoice_level:,
|
656
|
+
# The percentage (as a value between 0 and 1) by which to discount the price
|
657
|
+
# intervals this adjustment applies to in a given billing period.
|
572
658
|
percentage_discount:,
|
659
|
+
# The plan phase in which this adjustment is active.
|
573
660
|
plan_phase_order:,
|
661
|
+
# The reason for the adjustment.
|
574
662
|
reason:,
|
575
663
|
adjustment_type: :percentage_discount
|
576
664
|
); end
|
@@ -639,11 +727,19 @@ module Orb
|
|
639
727
|
end
|
640
728
|
def self.new(
|
641
729
|
id:,
|
730
|
+
# The price IDs that this adjustment applies to.
|
642
731
|
applies_to_price_ids:,
|
732
|
+
# True for adjustments that apply to an entire invocice, false for adjustments
|
733
|
+
# that apply to only one price.
|
643
734
|
is_invoice_level:,
|
735
|
+
# The item ID that revenue from this minimum will be attributed to.
|
644
736
|
item_id:,
|
737
|
+
# The minimum amount to charge in a given billing period for the prices this
|
738
|
+
# adjustment applies to.
|
645
739
|
minimum_amount:,
|
740
|
+
# The plan phase in which this adjustment is active.
|
646
741
|
plan_phase_order:,
|
742
|
+
# The reason for the adjustment.
|
647
743
|
reason:,
|
648
744
|
adjustment_type: :minimum
|
649
745
|
); end
|
@@ -708,10 +804,17 @@ module Orb
|
|
708
804
|
end
|
709
805
|
def self.new(
|
710
806
|
id:,
|
807
|
+
# The price IDs that this adjustment applies to.
|
711
808
|
applies_to_price_ids:,
|
809
|
+
# True for adjustments that apply to an entire invocice, false for adjustments
|
810
|
+
# that apply to only one price.
|
712
811
|
is_invoice_level:,
|
812
|
+
# The maximum amount to charge in a given billing period for the prices this
|
813
|
+
# adjustment applies to.
|
713
814
|
maximum_amount:,
|
815
|
+
# The plan phase in which this adjustment is active.
|
714
816
|
plan_phase_order:,
|
817
|
+
# The reason for the adjustment.
|
715
818
|
reason:,
|
716
819
|
adjustment_type: :maximum
|
717
820
|
); end
|
@@ -764,8 +867,20 @@ module Orb
|
|
764
867
|
sig do
|
765
868
|
params(day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)).returns(T.attached_class)
|
766
869
|
end
|
767
|
-
def self.new(
|
768
|
-
|
870
|
+
def self.new(
|
871
|
+
# The day of the month on which the billing cycle is anchored. If the maximum
|
872
|
+
# number of days in a month is greater than this value, the last day of the month
|
873
|
+
# is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing
|
874
|
+
# period begins on the 30th.
|
875
|
+
day:,
|
876
|
+
# The month on which the billing cycle is anchored (e.g. a quarterly price
|
877
|
+
# anchored in February would have cycles starting February, May, August, and
|
878
|
+
# November).
|
879
|
+
month: nil,
|
880
|
+
# The year on which the billing cycle is anchored (e.g. a 2 year billing cycle
|
881
|
+
# anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.).
|
882
|
+
year: nil
|
883
|
+
); end
|
769
884
|
sig { override.returns({day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)}) }
|
770
885
|
def to_hash; end
|
771
886
|
end
|
@@ -809,10 +924,15 @@ module Orb
|
|
809
924
|
.returns(T.attached_class)
|
810
925
|
end
|
811
926
|
def self.new(
|
927
|
+
# Only available if discount_type is `amount`.
|
812
928
|
amount_discount:,
|
929
|
+
# The price ids that this discount interval applies to.
|
813
930
|
applies_to_price_ids:,
|
931
|
+
# The price interval ids that this discount interval applies to.
|
814
932
|
applies_to_price_interval_ids:,
|
933
|
+
# The end date of the discount interval.
|
815
934
|
end_date:,
|
935
|
+
# The start date of the discount interval.
|
816
936
|
start_date:,
|
817
937
|
discount_type: :amount
|
818
938
|
); end
|
@@ -869,10 +989,16 @@ module Orb
|
|
869
989
|
.returns(T.attached_class)
|
870
990
|
end
|
871
991
|
def self.new(
|
992
|
+
# The price ids that this discount interval applies to.
|
872
993
|
applies_to_price_ids:,
|
994
|
+
# The price interval ids that this discount interval applies to.
|
873
995
|
applies_to_price_interval_ids:,
|
996
|
+
# The end date of the discount interval.
|
874
997
|
end_date:,
|
998
|
+
# Only available if discount_type is `percentage`.This is a number between 0
|
999
|
+
# and 1.
|
875
1000
|
percentage_discount:,
|
1001
|
+
# The start date of the discount interval.
|
876
1002
|
start_date:,
|
877
1003
|
discount_type: :percentage
|
878
1004
|
); end
|
@@ -929,10 +1055,16 @@ module Orb
|
|
929
1055
|
.returns(T.attached_class)
|
930
1056
|
end
|
931
1057
|
def self.new(
|
1058
|
+
# The price ids that this discount interval applies to.
|
932
1059
|
applies_to_price_ids:,
|
1060
|
+
# The price interval ids that this discount interval applies to.
|
933
1061
|
applies_to_price_interval_ids:,
|
1062
|
+
# The end date of the discount interval.
|
934
1063
|
end_date:,
|
1064
|
+
# The start date of the discount interval.
|
935
1065
|
start_date:,
|
1066
|
+
# Only available if discount_type is `usage`. Number of usage units that this
|
1067
|
+
# discount is for
|
936
1068
|
usage_discount:,
|
937
1069
|
discount_type: :usage
|
938
1070
|
); end
|
@@ -1019,14 +1151,18 @@ module Orb
|
|
1019
1151
|
.returns(T.attached_class)
|
1020
1152
|
end
|
1021
1153
|
def self.new(
|
1154
|
+
# The price ids that this maximum interval applies to.
|
1022
1155
|
applies_to_price_ids:,
|
1156
|
+
# The price interval ids that this maximum interval applies to.
|
1023
1157
|
applies_to_price_interval_ids:,
|
1158
|
+
# The end date of the maximum interval.
|
1024
1159
|
end_date:,
|
1160
|
+
# The maximum amount to charge in a given billing period for the price intervals
|
1161
|
+
# this transform applies to.
|
1025
1162
|
maximum_amount:,
|
1163
|
+
# The start date of the maximum interval.
|
1026
1164
|
start_date:
|
1027
|
-
)
|
1028
|
-
end
|
1029
|
-
|
1165
|
+
); end
|
1030
1166
|
sig do
|
1031
1167
|
override
|
1032
1168
|
.returns(
|
@@ -1075,14 +1211,18 @@ module Orb
|
|
1075
1211
|
.returns(T.attached_class)
|
1076
1212
|
end
|
1077
1213
|
def self.new(
|
1214
|
+
# The price ids that this minimum interval applies to.
|
1078
1215
|
applies_to_price_ids:,
|
1216
|
+
# The price interval ids that this minimum interval applies to.
|
1079
1217
|
applies_to_price_interval_ids:,
|
1218
|
+
# The end date of the minimum interval.
|
1080
1219
|
end_date:,
|
1220
|
+
# The minimum amount to charge in a given billing period for the price intervals
|
1221
|
+
# this minimum applies to.
|
1081
1222
|
minimum_amount:,
|
1223
|
+
# The start date of the minimum interval.
|
1082
1224
|
start_date:
|
1083
|
-
)
|
1084
|
-
end
|
1085
|
-
|
1225
|
+
); end
|
1086
1226
|
sig do
|
1087
1227
|
override
|
1088
1228
|
.returns(
|
@@ -1263,14 +1403,40 @@ module Orb
|
|
1263
1403
|
end
|
1264
1404
|
def self.new(
|
1265
1405
|
id:,
|
1406
|
+
# The day of the month that Orb bills for this price
|
1266
1407
|
billing_cycle_day:,
|
1408
|
+
# The end of the current billing period. This is an exclusive timestamp, such that
|
1409
|
+
# the instant returned is exactly the end of the billing period. Set to null if
|
1410
|
+
# this price interval is not currently active.
|
1267
1411
|
current_billing_period_end_date:,
|
1412
|
+
# The start date of the current billing period. This is an inclusive timestamp;
|
1413
|
+
# the instant returned is exactly the beginning of the billing period. Set to null
|
1414
|
+
# if this price interval is not currently active.
|
1268
1415
|
current_billing_period_start_date:,
|
1416
|
+
# The end date of the price interval. This is the date that Orb stops billing for
|
1417
|
+
# this price.
|
1269
1418
|
end_date:,
|
1419
|
+
# An additional filter to apply to usage queries.
|
1270
1420
|
filter:,
|
1421
|
+
# The fixed fee quantity transitions for this price interval. This is only
|
1422
|
+
# relevant for fixed fees.
|
1271
1423
|
fixed_fee_quantity_transitions:,
|
1424
|
+
# The Price resource represents a price that can be billed on a subscription,
|
1425
|
+
# resulting in a charge on an invoice in the form of an invoice line item. Prices
|
1426
|
+
# take a quantity and determine an amount to bill.
|
1427
|
+
#
|
1428
|
+
# Orb supports a few different pricing models out of the box. Each of these models
|
1429
|
+
# is serialized differently in a given Price object. The model_type field
|
1430
|
+
# determines the key for the configuration object that is present.
|
1431
|
+
#
|
1432
|
+
# For more on the types of prices, see
|
1433
|
+
# [the core concepts documentation](/core-concepts#plan-and-price)
|
1272
1434
|
price:,
|
1435
|
+
# The start date of the price interval. This is the date that Orb starts billing
|
1436
|
+
# for this price.
|
1273
1437
|
start_date:,
|
1438
|
+
# A list of customer IDs whose usage events will be aggregated and billed under
|
1439
|
+
# this price interval.
|
1274
1440
|
usage_customer_ids:
|
1275
1441
|
); end
|
1276
1442
|
sig do
|
@@ -1364,8 +1530,7 @@ module Orb
|
|
1364
1530
|
extend Orb::Internal::Type::Enum
|
1365
1531
|
|
1366
1532
|
TaggedSymbol = T.type_alias { T.all(Symbol, Orb::Models::SubscriptionTriggerPhaseResponse::Status) }
|
1367
|
-
OrSymbol =
|
1368
|
-
T.type_alias { T.any(Symbol, String, Orb::Models::SubscriptionTriggerPhaseResponse::Status::TaggedSymbol) }
|
1533
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
1369
1534
|
|
1370
1535
|
ACTIVE = T.let(:active, Orb::Models::SubscriptionTriggerPhaseResponse::Status::TaggedSymbol)
|
1371
1536
|
ENDED = T.let(:ended, Orb::Models::SubscriptionTriggerPhaseResponse::Status::TaggedSymbol)
|
@@ -1415,8 +1580,16 @@ module Orb
|
|
1415
1580
|
)
|
1416
1581
|
.returns(T.attached_class)
|
1417
1582
|
end
|
1418
|
-
def self.new(
|
1419
|
-
|
1583
|
+
def self.new(
|
1584
|
+
# The credit notes that were created as part of this operation.
|
1585
|
+
created_credit_notes:,
|
1586
|
+
# The invoices that were created as part of this operation.
|
1587
|
+
created_invoices:,
|
1588
|
+
# The credit notes that were voided as part of this operation.
|
1589
|
+
voided_credit_notes:,
|
1590
|
+
# The invoices that were voided as part of this operation.
|
1591
|
+
voided_invoices:
|
1592
|
+
); end
|
1420
1593
|
sig do
|
1421
1594
|
override
|
1422
1595
|
.returns(
|