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